Online code formatter and refiner

Code Refiner

Format and clean up JavaScript, TypeScript, HTML, CSS, JSON, YAML, Markdown and SQL in your browser. Choose indentation and copy the result.

0 / 100.000

Up to 100,000 characters. The content is processed in this browser.

Formatted code

How to format code

Choose the language so its formatting rules can be applied. The result is formatted text; it does not execute the code.

  1. 1Select the language of the code you pasted.
  2. 2Choose 2 or 4 spaces, or tabs for indentation.
  3. 3Press “Format code,” review the result and copy it.

Quick guide

Organize code without changing what it does

A refiner organizes spaces, line breaks and indentation so code is easier to read. The result may be clearer, but formatting alone does not confirm that a program works as expected.

Available languages

You can format JavaScript, TypeScript, HTML, CSS, JSON, YAML, Markdown and SQL. The selector matters because every language has different rules and structures.

Formatters can report syntax errors when they cannot interpret the text. That does not mean they execute the program, inspect its dependencies or verify that the logic is correct.

Choose the indentation your project uses

Indentation can use 2 spaces, 4 spaces or tabs. If you work in an existing project, keep the option used by its other files so changes stay consistent.

Formatting can reorganize the text and leave it different from the original. Review the result before replacing your code, especially when the file follows particular rules.

Your code is processed in the browser

Formatting runs locally on this page. The code is not sent to a server or saved here.

Frequently asked questions

Which languages does the refiner support?

JavaScript, TypeScript, HTML, CSS, JSON, YAML, Markdown and SQL.

Does the refiner fix program errors?

No. It formats text, and some formatters detect syntax errors that prevent processing. It does not execute code or verify its behavior.

Is my code sent to a server?

No. Formatting happens in your browser and the code is not stored or transmitted by this tool.

Can I format a very large file?

The limit is 100,000 characters per operation to keep the tool responsive in the browser.