Indent Text

Add or remove a chosen number of leading spaces on each non-empty line.

What Indent Text helps you do

Add or remove a chosen number of leading spaces on each non-empty line. It is the formatting tweak for shifting a block of code or quoted text left or right in one action. Empty lines are left alone, so the block does not gain trailing whitespace.

Indentation changes are made in your browser and are not sent to Haivix.

How it works

Each cleanup tool applies one deterministic string transformation to the pasted text inside the page. There is no parser, model or server call: the same input and options produce the same output every time. The browser holds the text in memory, so the result updates as you edit and is not retained after the tab closes. Because the transformation is literal, non-breaking spaces, mixed line endings and tabs may behave differently from a word processor; compare a short sample before applying it to a large file. The page never rewrites the source on disk, so the only undo is your own copy.

How to use Indent Text

  1. Paste the block of text.
  2. Choose to indent or unindent and set the number of spaces.
  3. Apply and check the first and last lines.
  4. Copy the shifted text.

When to use it

  • Indent a pasted code block to nest it inside a function or list.
  • Unindent text that was indented one level too deep.
  • Shift a quoted passage to align with surrounding copy.
  • Prepare a block for a Markdown blockquote or nested list.
  • Align a pasted configuration excerpt with the surrounding file.
  • Remove a uniform margin from a code sample.

When not to use it

  • Do not use it on prose where a first-line indent would look wrong.
  • Do not use it to change internal alignment; it only touches the start of each line.
  • Do not expect unindent to restore indentation that was not there.

Example

Indenting three lines by two spaces adds two spaces in front of each non-empty line. Unindenting by four removes four spaces from lines that have them and removes whatever leading whitespace exists on lines with less. Internal spacing between words is unchanged.

What you can do with Indent Text

  • Indent every non-empty line by 0–32 spaces.
  • Unindent by a chosen number of spaces.
  • Leave blank lines untouched.
  • Remove up to the requested amount when a line has less indentation.
  • Copy the shifted block.
  • Run the change locally with no upload.

Example: verify the cleanup on a sample

Paste a short, representative sample first rather than the whole file. Check the edges: leading and trailing spaces, blank lines, tabs and any non-breaking spaces the source may contain.

Apply the transformation and compare the sample with the original. If the change is correct, run the full text; if not, adjust the source or choose a different cleanup tool.

Copy or download the result and keep the original until the destination import succeeds. Most of these tools are one-way, so the source file is the only reliable undo.

If the text came from a PDF, a spreadsheet or a CMS, look for invisible characters before blaming the cleanup. A no-break space or a soft hyphen can survive the pass and still break a comparison downstream.

Run the cleaned text through the destination's preview or import step before deleting anything. A formatting change that looks right in the textarea can still fail a strict parser.

What to know before you start

  • Unindenting removes up to the requested spaces, so lines with less indentation may become flush left.
  • It only changes leading whitespace and leaves internal alignment untouched.
  • It does not expand tabs; a tab counts as one character in the leading whitespace.
  • Empty lines are not padded.

Common mistakes

  • Unindenting more than the existing indentation and flattening the block.
  • Expecting empty lines to receive indentation.
  • Using it to align columns inside a line rather than at the start.
  • Applying it to prose and getting a first-line indent.
  • Forgetting that tabs are not expanded by this tool.

Troubleshooting

If some lines did not shift, they were empty or had less leading whitespace than requested.

If the block is now flush left, the unindent amount exceeded the existing indentation.

If tabs remain, convert tabs to spaces first.

If the result looks uneven, the source had mixed indentation; normalize it before shifting.

Related standards and documentation

  • Unicode whitespace includes characters such as the no-break space that may not look like a space.
  • Line endings may be CRLF, LF or CR before cleanup; normalize them first when the target requires one style.
  • The tools operate on Unicode text, not on bytes in a legacy encoding.
One transformation, checked on a sample
  • Compare a short sample first.
  • Watch for non-breaking spaces and tabs.
  • Keep the original until the import works.

Frequently Asked Questions