Skip to content
Created by Iternal Technologies, the AI Strategy ExpertsBy Iternal (opens in a new tab)

Format & Minify

JavaScript Beautify

JavaScript

Paste JavaScript to reindent it with two-space braces.

Beautified JavaScript

About JavaScript Beautify

JavaScript Beautify reindents code. Outside strings, templates, comments and regular expressions it puts a newline after each opening brace and semicolon and before each closing brace, then indents with two spaces per brace. It does not add line breaks inside parentheses.

Quotes, template literals and regular expressions are copied unchanged, so a comment marker or a placeholder inside them stays put. A slash starts a regular expression only after a delimiter such as an equals sign, a parenthesis, return, throw or case. Division stays division.

This is a whitespace formatter, not a full JavaScript parser. It does not understand TypeScript types, JSX or every regular-expression edge. A less-than sign that might start a JSX tag is left alone, and locals are not renamed.

Frequently asked questions

What does JavaScript beautify change?

It inserts a newline after an opening brace and a semicolon, and before a closing brace, then indents with two spaces per brace. Those breaks are skipped inside parentheses. Spaces you already typed between tokens are kept as a single space.

Will text inside a string or template change?

No. Single quotes, double quotes and template literals are copied as written, including /*, // and ${. A regular expression after return, throw or a similar keyword is copied too, spaces included.

Does this parse TypeScript or JSX?

No. Types, generics and JSX tags are not parsed. A less-than sign is left as a comparison, even when it might open a JSX tag. Not every regular-expression edge is recognized.

Is the text I paste uploaded anywhere?

No. Beautifying runs in your browser and the JavaScript you paste is never uploaded, logged or stored. Google Analytics records page views and feature use, never content.

Iternal · AI Blueprint Builder

Plan the AI initiative, not just the output

The AI Blueprint Builder scores each use case across value, feasibility, cost, governance, risk, adoption and readiness before you commit budget. Free to start, about 60 minutes.

Open the AI Blueprint Builder (opens in a new tab)