JavaScript / CSS Formatter

Format JavaScript and CSS source code

Features

Format both JS and CSS

Format JavaScript and CSS separately by switching tabs

Choose from 4 indent widths

Supports 2 spaces, 4 spaces, tabs, and minify

Choose the brace style

Specify whether the opening brace is on the same line or a new line in JS

Stable with Prettier

Stable output results from the standard formatting library

How to Use

1

Select the language tab

Switch between the JavaScript and CSS tabs to specify the target

2

Paste the code

Enter the source code you want to format in the input field

3

Set the style

Choose the indent width and brace style to your liking

4

Run the formatting

Press the format button to display the result, ready to copy or save

Use Cases

Format before code review

Tidy messy code into a uniform style to streamline review

Make minified code readable

Expand minified code to decipher its content

Minify deliverable code

Reduce file size for distribution with the minify option

Clean up sample code for study

Tidy copied code for readability to aid understanding

Safety and Privacy

Runs entirely in your browser

Your input data is processed only within your browser and is never sent externally.

Processing only in your browser

code formatting is processed entirely within your browser, and input data is not sent to any server.

Communications encrypted with HTTPS

Page loading is also encrypted by TLS, and content cannot be read by third parties.

No transmission to third parties

Input content is not sent to external services such as ad networks or trackers.

No automatic saving of results

the formatted result and input suggestions are not stored on the server.

Related Tools