About Indent Text
Indent Text adds a fixed number of spaces to the front of every line you paste in. The count is yours to choose between zero and twenty, and the default of two is the common convention for one nesting level in code and configuration files. A two-line sample is filled in to start with, so the effect is visible the moment the page loads.
The prefix is added in front of whatever a line already begins with, and nothing that is already there is taken away. Existing leading spaces are kept and the new ones land before them, blank lines receive the prefix just like lines with content, and no line is trimmed, re-wrapped or joined to its neighbour at any point. The text is split on newlines, each piece gets the same treatment, and the pieces are put back together in the same order they arrived.
That uniformity is the point. Unlike an editor, which indents a selection you have already had to make, this works on a whole block at once and applies one depth everywhere, which is the right tool when a log extract, a config snippet or a bullet list needs one level added across the board. It produces spaces only - a style that calls for tabs, or for mixed tab-and-space indentation, has to be finished in the editor afterwards.
How to use Indent Text
- 1 Paste the text you want indented into the panel, or start from the two-line sample.
- 2 Set the spaces count - two gives one conventional nesting level, and the field allows zero to twenty.
- 3 Run the tool and read the result, in which every line now carries the prefix.
- 4 Copy the output, and repeat with a different count if the first depth was not the one you needed.
Frequently asked questions
Does it replace the indentation my lines already have?
No. The new spaces are added in front of whatever each line starts with, and existing leading whitespace is kept untouched beneath them. If a line already begins with four spaces and you ask for two more, it will begin with six.
What happens to empty lines?
They receive the prefix like every other line. A blank line stays visually blank in most editors because the spaces are invisible, but they are in the file, and a tool that measures line length will see them. Setting the count to zero is the only way to leave blank lines at zero characters.
Can it indent with tabs instead of spaces?
Not at any setting. The prefix is built from space characters only, so a tab-indented code style, or a scheme that mixes tabs and spaces, has to be completed in a text editor after copying the result out.
Can I indent one part of the text more than the rest?
No. One count applies to every line in the panel, and the page has no understanding of nesting or structure. To push one block a level deeper, run the whole text once here and then finish the selected lines in an editor.
Free, online, and private
Free to use
Indent Text is completely free. There is no account to create, no login, and no hidden charge or usage limit.
Runs online in your browser
It is a free online tool that runs entirely in your browser. Nothing to download or install — open the page and start using it right away.
Your data stays private
All processing happens locally on your device. Your input is never uploaded, stored, or tracked, so it never leaves your browser.
How Indent Text behaves in detail
These are the specifics of this implementation — the exact ranges, defaults and fixed settings you are working with.
| Parameter | Value |
|---|---|
| Inputs | a text area defaulting to two lines, and a spaces count defaulting to 2 with a declared floor of 0 and a ceiling of 20 |
| Rule | every line receives that many leading spaces, added in front of whatever the line already starts with |
| Empty lines | blank lines receive the same prefix, so they stay blank only when the count is zero |
| Line handling | the text is split on newlines, each piece is prefixed, and the pieces are rejoined with newlines |
| Existing whitespace | nothing is trimmed and nothing is re-wrapped - a line that already begins with spaces keeps them and the new prefix lands in front |
| Clamping | the run function does not re-clamp the count; the 0 to 20 range lives in the number field declaration |
Compiled from the implementation of this tool and checked against it by itoolnet.
What Indent Text does not do
Knowing the edges of a tool saves more time than another list of its features. These are the cases where it will not do what you might expect.
- The prefix is spaces only. Tabs cannot be produced at any setting, so a code style that requires tab indentation - or a mix of tabs for the first level and spaces after - has to be finished in the editor, and a tab-heavy file cannot be converted here.
- The same prefix lands on every line, with no sense of nesting or structure. Indenting a block one level deeper than the rest means selecting those lines in an editor; this page cannot look at the content and vary the depth.
- A count typed outside the declared range is not corrected by the run function. The field declares 0 to 20, but the arithmetic trusts the value it receives, so the number box is the only guard and pasted values bypass it.
Tested and documented by itoolnet, the team that builds and maintains this site.