Shell Script Formatter

Indent Bash and sh scripts, loops and functions.

Shell Script Formatter

.sh · .bash

Paste text or open a file to see the result.

What it does

Indents Bash and sh scripts, including if blocks, loops, case statements and functions. It helps when a script grew over time and is hard to follow before you change it. Commands stay the same, only the layout changes.

About the .sh format

.SH file extension

.sh Bash Shell Script

Developer Files

File Type
Bash Shell Script
Developer
Bourne shell
MIME
application/x-sh

The .SH file extension is a Bash Shell Script.

Also works with

Shell Script Formatter questions

How do I use the Shell Script Formatter?

Paste the text into the Input box or open a file, set the options, then copy or download the result.

Does renaming a file to .sh change its format?

No. The extension only tells programs what to expect, and the content of the file stays the same. To change the format, convert the file. The .sh page lists programs and converters for it.