Free Toolkit

Indent/Dedent TextAdd or remove indentation from text with spaces or tabs.

Indent/Dedent Text illustration
📝

Indent/Dedent Text

Add or remove indentation from text with spaces or tabs.

How to Use
1

Paste Text

Paste text to indent or dedent.

2

Configure

Choose indent/dedent mode, tab/space, and amount.

3

Copy Result

Copy the re-indented text.

What Is Indent/Dedent Text?

The Indent/Dedent Text tool adds or removes indentation from every line of text. In indent mode, it prepends the specified indentation (spaces or a tab) to each line. In dedent mode, it removes leading whitespace from each line up to the specified amount. You can choose between space-based indentation (configurable 1-16 spaces) or tab-based indentation. This is useful for adjusting code indentation, formatting text blocks, and preparing content for different indentation contexts.

Why Use Our Indent/Dedent Text?

  • Add consistent indentation to text blocks
  • Remove unwanted leading indentation
  • Switch between tab and space indentation
  • Configurable indent amount

Common Use Cases

Code Formatting

Add or remove indentation levels from code blocks.

Email Quoting

Indent text blocks for email quoting or documentation.

Content Preparation

Adjust indentation for pasting into different contexts.

Documentation

Format code examples with proper indentation.

Technical Guide

In indent mode, the tool prepends a string of spaces (repeated by the specified amount) or a tab character to every line. In dedent mode, it processes each line individually: for tab mode, it removes one leading tab if present; for space mode, it counts and removes up to the specified number of leading spaces. This per-line approach ensures consistent results regardless of varying indentation levels across lines. Dedent never removes more characters than available on each line.

Tips & Best Practices

  • 1
    Indent adds whitespace to the beginning of every line
  • 2
    Dedent removes whitespace from the beginning of every line
  • 3
    Use tab mode for tab-based indentation
  • 4
    Dedent will not remove more spaces than exist on each line

Related Tools

Frequently Asked Questions

QWhat is the difference between indent and dedent?
Indent adds whitespace to the start of each line. Dedent removes whitespace from the start of each line.
QDoes dedent remove all indentation?
It removes up to the specified amount. To remove all indentation, use a large value or repeat the operation.
QCan I use tabs instead of spaces?
Yes, toggle the tab option to indent/dedent with tab characters.
QDoes it affect empty lines?
Indent adds whitespace to all lines including empty ones. Dedent only removes existing whitespace.
QHow many spaces can I indent by?
The space amount is configurable from 1 to 16 characters.

About Indent/Dedent Text

Indent/Dedent Text is a free online tool from FreeToolkit.ai. All processing happens directly in your browser — your data never leaves your device. No registration required. No ads. Just fast, reliable tools.