Runs in your browser

Code Formatter

Tidy up minified or badly indented code. Fourteen languages, formatted on your own machine — your code is never uploaded, which matters when the snippet you are debugging contains a key or a customer record.

LanguageIndent
Output
Nothing formatted yet

Java, Python, C, C++, C#, PHP, Swift, Kotlin, Objective-C and Protobuf are not listed. Their formatters are native programs with no browser build, so supporting them would mean uploading your code to a server — which this site does not do.

How to use it

  1. Choose the language, or load the example to see the shape.
  2. Paste your code into the input pane.
  3. Pick an indent — two spaces, four, or tabs.
  4. Select Format, then copy or download the result.

Questions

Is my code uploaded? No. The formatter runs in your browser using your own device. Open the Network tab and format something — no request carries your code. That is worth caring about: pasting a snippet into an online formatter is one of the most common ways API keys and customer data leak out of a company.

Why are Java, Python and C++ not listed? Their formatters — google-java-format, Black, clang-format — are native programs with no browser build. Supporting them would mean sending your code to a server to be processed, which is exactly what this site does not do. We would rather leave a language out than quietly break the promise the rest of the site makes.

Which formatter does it use? Prettier for JavaScript, TypeScript, CSS, SCSS, LESS, HTML, Vue, YAML, Markdown and GraphQL; sql-formatter for SQL. JSON and XML are handled directly. The output matches what Prettier would produce locally, so it will not fight your project’s own setup.

Can it minify? JSON, yes — the Minify button strips all whitespace. For other languages, minification is a build-tool job rather than a formatting one.

Why keep the input and output separate? So a bad result costs nothing. A formatter that rewrites your text in place loses the original, and there is no undo across a reformat.