Input Shell
Paste your code to format it and check its syntax
Options
Adjust formatting and validate
Detect the format on paste. If ambiguous, choose it manually.
Result
Code viewer · Read only
Format and validate Shell online
Format .sh scripts with shfmt and Bash syntax. Preserve comments, quotes and heredocs. Check syntax without executing commands; program availability is not validated.
How to use the formatter
- Paste your code in the editor. JSON is the default format on the home page.
- Enable detection on paste or choose the format manually. HTML and XML can be ambiguous.
- Adjust indentation and select Format or Validate. The viewer includes syntax colors and folding for every format. Minification is available for JSON.
Code example Shell
#!/bin/bash
for name in Ada Grace; do
echo "Hello $name"
done
Is my code sent to a server?
No. Processing takes place in your browser. Pasted code is neither uploaded nor stored on the server.
What does validation check?
It checks syntax with the selected format’s parser. It does not execute code or guarantee that a program works correctly. If there is an error, fix the input and validate again.