Code Formatter

Format JavaScript, TypeScript, JSON, CSS or HTML with Prettier, running entirely in this tab.

  • 100% Free
  • No account required
  • Runs in your browser
  • No data is uploaded
Not saved automatically

Private to this browser, not a cloud backup. Saves expire 7 days after the last save. Avoid saving sensitive data on shared devices.

Saved Code Formatter workspaces

Saved only on this device. Clearing browser data removes your workspaces. Expired saves are removed when this app next checks storage.

No saved workspaces for this tool yet.

JavaScript to Formatted code

Input

Paste or edit your source, then click “Run tool”.

Type, paste or drop a file
JavaScript
Ln 1, Col 1Spaces: 2UTF-853 bytes

Output

Formatted code (read-only).

Read-only
Text
Ln 1, Col 1Spaces: 2UTF-80 bytes
Ready when you arePaste your input, then press Run tool or ⌘ ↵

Using the Code Formatter

Overview

Format JavaScript, TypeScript, JSON, CSS or HTML with Prettier, running entirely in this tab.

Tidy snippets copied from answers, logs or chat before they go into your code.

How to use it

  1. Paste or type your JavaScript into Input, drop a file onto it, or press Example to load a sample.
  2. Choose the settings in the Language bar under the editors.
  3. Press Run tool, or ⌘ ↵ from anywhere on the page.
  4. Read the result in Output, then copy or download it. The Result tab has size, line counts and next steps.

Input

Source.

Settings

  • Language — JavaScript, TypeScript, JSON, CSS, HTML

Output

Formatted code.

  • JavaScript and TypeScript
  • JSON, CSS and HTML
  • Formatted with Prettier
  • The same output every time

Tips

  • Choose the language before formatting; the formatter does not guess.
  • Formatting never changes behaviour, only layout.
  • Config files are parsed as well as formatted, so mistakes surface here.

Keyboard shortcuts

⌘ ↵
Run the tool
⌘ K
Search every tool
/
Filter the sidebar