woori.today
Family Sites

JavaScript Formatter

Format JavaScript code without running it.

JavaScript Formatter: Input / Result

Input

const total=1+2

Result

const total = 1 + 2;

How it works

Formats JavaScript indentation and line breaks with Prettier's Babel and ESTree plugins at a 100-column print width. It does not run the code.

A practical use

Paste compact source, run the formatter, and copy the laid-out result for review or sharing.

When something goes wrong

The source must parse as JavaScript. Formatting is not type checking or runtime validation. If parsing fails, inspect brackets, quotes, and missing input.

Tool-specific question

Does the formatter execute JavaScript?

No. It only formats source text.

How to use

  1. Enter an input or choose settings; you can start with const x=1;.
  2. Enter code or structured data, then set the format, pattern, or conversion direction.
  3. Run JavaScript Formatter, then compare the result with the example formatted JavaScript source before copying or downloading it.

Options

The input area shows the accepted format and available controls for this tool.

Privacy

No. Your input is handled in the browser you are using. Privacy

Related tools