Code Snippet Formatter
Format source code online with Prettier. Supports JavaScript, TypeScript, JSON, CSS, HTML, and Markdown.
Format snippets for review or documentation. Prettier runs in the browser; pick a language and indentation width.
Formatting happens locally; code is not transmitted.
Use cases
- Normalize snippets before publishing blog posts.
- Format JSON or CSS copied from browser devtools.
- Prepare examples for pull request descriptions.
Frequently asked questions
Why is C# not listed?
Reliable C# formatting is not bundled in this browser build. Use Visual Studio or dotnet format for C# projects.
Does formatting change logic?
Prettier adjusts whitespace and quotes in supported languages; it does not change runtime behavior for JS/TS.
Can I change tab width?
Yes. Choose indentation between 2 and 8 spaces before formatting.
Related tools
Automate GitHub code review and formatting drift detection with CodeInspector.