Skip to main content
WizTools123
WizTools123
Free Online Tools

Tool Categories


Text Tools New Tool

Free Online Text Indenter, Indent or Unindent Every Line

Indent a whole block of text or take the indentation off again. Pick spaces or tabs and how many, indent only some lines, or remove the smallest indentation the block shares so that nested lines keep their relative shape instead of being flattened.

Free Forever Nothing Uploaded Indent or unindent Keeps nesting
Free Online Text Indenter, Indent or Unindent Every Line
Share this tool
Advertisement Slot (Top Banner) Google AdSense Unit • Responsive Banner
Text Indenter Everything happens in this tab. Nothing you paste is sent anywhere.
Your text
0 characters 0 words 0 lines
Result
0 characters 0 lines
What to do
By how much
Lines

0 lines 0 changed 0 smallest indent 0 largest indent

Buy Us A Coffee

Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.

Buy Us A Coffee
Sponsored Content (Below Tool) Google AdSense Placement

How to Indent or Unindent Text

A few steps, and nothing is uploaded.

1
Paste the block Code, a quote, a list, anything where every line needs to move together. Files can be dropped on the box.
2
Pick indent or unindent Indent adds the same amount to every line. Unindent removes the indentation the whole block shares, which keeps the nesting inside it.
3
Choose spaces or tabs Four spaces is the common default. If the file you are pasting into uses tabs, pick tabs here so the result matches it.
4
Copy the result The output box has the block at its new depth, ready to paste. The original is untouched in the left box.

What to Know About Indenting

Including what unindent does to lines that are already at the left.

Unindent removes the shared indentation, not a fixed amount. If the shallowest line has four spaces and a nested line has eight, taking four off both keeps the nesting. Taking four off every line regardless would be the same thing here, but on a block where one line is at zero it would push the rest against the margin and lose the shape.
Blank lines stay blank by default. Adding spaces to an empty line creates trailing whitespace, which shows up as a change in every diff and is flagged by most linters. Turn the switch on only if the thing you are pasting into needs it.
Tabs and spaces are counted differently. When working out the shared indentation, a tab counts as one character rather than as a number of columns. On a block that mixes both, convert it first with the tabs and spaces tool, otherwise the shared amount is measured against two different units.
The match filter is plain text, not a regular expression. Type a word and only lines containing that word are indented. It is there for jobs such as indenting only the lines that mention a particular key, and it deliberately does not accept patterns.

Key Features & Capabilities

What this tool does, and what it deliberately does not.

Both directions Indent deeper, unindent by the shared amount, or strip the indentation off completely.
Nesting survives Unindent measures the block before it cuts, so inner levels keep their relative depth.
Spaces or tabs Choose the unit and the count, so the result matches the file you are pasting into.
Only some lines Indent only the lines that contain a given word, leaving everything else where it is.
Measured first The smallest and largest indentation in the block are shown, so you know what you are about to change.
Nothing uploaded Source code and internal documents stay in the tab. There is no server in the middle.

About the Text Indenter

Moving a block of text one level in or out is a two second job in an editor and a nuisance everywhere else: in a comment box, in an email, in a chat message, in a content management system that eats tabs. This page does the same thing as the editor command, without needing the editor.

The part that is easy to get wrong is unindenting. The naive version removes a fixed number of characters from the start of every line, which works until one line is already at the margin, and then everything after it is pulled left by a different amount and the structure collapses. Measuring the shared indentation first and removing exactly that keeps the inner shape intact, which is the behaviour people expect without being able to name it.

The counters are there for the same reason as elsewhere on this site: so that you can see what the text is before you change it. A block whose smallest indent is three and largest is eleven is telling you something about how it was written, usually that two people used different settings.

Frequently Asked Questions

Tabs, blank lines, nesting and markdown code blocks.

Unindent removes the amount every line shares, so a nested block keeps its nesting. Remove all indentation pushes every line hard against the left margin, which flattens the structure. The first is what you usually want; the second is for turning a quoted block back into plain text.

Because indenting them would leave invisible trailing whitespace, which shows up in diffs and is flagged by linters. If you need it, switch on "Indent blank lines too".

Yes. Four spaces is the classic markdown code block indentation, which is the default here. Fenced code blocks with backticks need no indentation at all, so in that case you want the unindent mode instead.

It will indent it, but the measurement for unindenting counts a tab as one character, so a mixed block gives a result that depends on which came first. Convert the block to one or the other first with the tabs and spaces converter.

Forty units per step, which is deeper than any sensible document needs. Run it twice if you really want more.

Other Text Tools

Advertisement Slot (Bottom Banner) Google AdSense Unit • Responsive Banner