Unindent Text
Remove indentation from every line of text. Runs entirely in your browser, so your data never leaves your device.
0 chars · 0 lines
Output
The result appears here as you type.
How to use Unindent Text
- 1. Paste the indented text. Drop in a block that carries leading whitespace, such as a code snippet copied out of a nested function or a section pasted from an indented outline.
- 2. Choose how to remove indentation. Pick Common indent to strip only the whitespace shared by every line, Fixed amount to remove a specific number of characters, or All indentation to flush every line completely left.
- 3. Set the Amount for fixed mode. When using Fixed amount, enter exactly how many characters to strip from the front of each line, matching the extra indentation depth you're removing.
- 4. Copy the unindented result. Copy the dedented block into your editor or document now that the unwanted leading whitespace is gone.
When to use Unindent Text
Unindent Text removes leading whitespace from every line, either the amount they all share or a fixed number of characters. It solves the common problem of code or config pasted out of a deeply nested context that needs to shift back to its natural indentation level.
- Fixing code copied from a deeply nested function. A function body was copied from three levels of nesting and now every line carries extra indentation that doesn't belong at the new location. Common indent strips exactly the shared excess.
- Un-indenting a code block pasted from a chat app. Slack or Discord sometimes adds a consistent extra indent to code blocks when copied out. Removing that fixed amount restores the original formatting before you paste it into your editor.
- Flattening a quoted or blockquoted section. An email reply quoted a section that now sits indented under a '>' prefix and needs to become plain paragraph text again. All indentation removes every bit of leading whitespace at once.
- Correcting a YAML block pasted at the wrong depth. A YAML fragment was copied from under a parent key and now needs to become top-level, so its consistent two-space indent has to go. Common indent strips it cleanly across every line.
Examples
Remove the shared indent
Input
if (ok) {
go();
}Output
if (ok) {
go();
}About the Unindent Text tool
Unindent Text is a free online tool that works entirely inside your web browser. Remove indentation from every line of text. Because the processing happens on your own device, nothing you enter is uploaded, logged or stored anywhere.
This page is one of 211 Text utilities on EditSafely. Each one does a single job well, and all of them follow the same rule: your input stays on your machine.
You can shape the output with 2 settings, including Remove and Amount (fixed mode), and the result refreshes the moment you change one. A worked example further down the page shows exactly what the tool produces for a real input.
Because nothing leaves your device, the tool is suitable for sensitive content such as internal documents, credentials or customer data. It also responds instantly, since every keystroke is handled on your own machine rather than by a remote API.
Frequently asked questions
Does Unindent Text cost anything?
Yes, it is completely free. All 2,658 tools on EditSafely work without an account, a subscription or usage limits.
Is it safe to paste sensitive or confidential data?
No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.
How much text can I process at once?
There is no fixed limit. Because the work happens on your own device rather than on a shared server, the practical ceiling is your machine's memory, which comfortably handles inputs far larger than typical online tools allow.
Do I need to sign up or install anything?
Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.
How do I use the result?
The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.