Code Formatter — Format & Minify

Paste code to format it with the language auto-detected. Choose indent, line width, semicolons, quotes and trailing commas; JavaScript, CSS and HTML can also be minified with before/after size and reduction. Your code never leaves the browser.

On-device・No upload

Your files and input are processed only inside your browser on this device and are never uploaded to our servers.

Input code
0 chars0 lines
OutputEnter code and the result appears here
Enter code and the result appears here

How to use

  1. Choose Format or Minify and paste code into the input pane (you can also open or drop a file; Shift_JIS files are read too).

  2. Leave the language on Auto-detect, which uses the file extension and the content. Pick one manually if it guesses wrong.

  3. When formatting, set indent (2/4 spaces or tab), line width, quotes, semicolons and trailing commas. When minifying, choose how comments are handled, whether to shorten local variable names, and whether to minify the contents of <style> and <script> in HTML.

  4. The result appears on the right. A syntax error shows the line, column and an excerpt, and “Go to error” selects that spot in the input.

  5. Copy or download the result. The extension follows your file, and minified files get .min.

What it does

Seven languages through Prettier

JavaScript (with JSX), TypeScript (with TSX), CSS, SCSS, Less, HTML and Vue (.vue) are formatted by Prettier 3.9.10. Formatting the output again changes nothing (idempotent). The engine for each language is loaded only when needed, so the first view stays light.

Language detected from extension and content

The file extension (.ts, .tsx, .scss, .vue …) wins; for pasted text the content (type annotations, interfaces, $variables, @mixin, HTML tags …) picks the candidates. If the first guess fails to parse, the next one is tried (for example TS after JS).

Errors with line and column; input is never cleared

Syntax errors are reported with line, column and an excerpt, and you can jump to the spot in the input. The engine’s message is shown on screen only and is never sent to notifications or logs.

Minifying that keeps the meaning

JavaScript goes through Terser (top-level names are not renamed). CSS keeps strings, url(), escapes and /*! comments byte for byte and only drops whitespace and comments. HTML keeps the contents of <pre>, <textarea> and elements with an inline white-space rule, attribute values, &nbsp;, and one space between inline elements.

A conservative HTML default

By default only whitespace that does not render is removed (in <head>, around table structure and so on). Removing whitespace around block elements such as <div> and <p> is an opt-in, because it can change the layout if your CSS changes `display`.

Reduction shown; Unicode-safe

Before/after size and the reduction are shown, and you are told when minifying makes the file larger (for example already-minified code). Japanese and other non-ASCII identifiers, comments and strings are left as they are.

Use cases

  • Make a one-line snippet from a log or bundle readable for review
  • Bring files with mixed styles to one set of rules (indent, quotes, semicolons)
  • Minify CSS, JavaScript or HTML for delivery while watching the size reduction
  • Check what Prettier would do without installing anything
  • Format or minify source you cannot upload anywhere

Supported formats

Input

.js.jsx.mjs.cjs.ts.tsx.css.scss.less.html.htm.vuePasted textUTF-8 / UTF-16 (BOM) / Shift_JIS

Output

Formatted code (saved with the original extension)Minified code (.min.js / .min.css / .min.html)

Capability matrix

FeatureSupportNotes
Format JavaScript, JSX, TypeScript, TSX, CSS, SCSS, Less, HTML and VueSupportedPrettier 3.9.10; <script lang="ts"> in Vue is formatted too
Format options (indent, width, quotes, semicolons, trailing commas)Supported—
Minify JavaScript (whitespace/comments, shorter local names)SupportedTerser; top-level names are not renamed
Minify CSSSupportedWhitespace and comments only; no rewriting of numbers, colors or selectors and no rule merging
Minify HTMLPartialOnly changes that keep the meaning. <pre> and <textarea> are kept; no renaming, tag omission or quote removal
Minify TypeScript, JSX, SCSS, Less or VueNot supportedIt needs a compile step to strip types or syntax. Convert to JS / CSS first (formatting works)
Format JSON, SQL, XML, YAML or MarkdownNot supportedUse JSON Studio, SQL Studio, XML Studio, YAML / TOML Studio or Markdown Studio
ObfuscationNot supportedLocal names are shortened, but nothing is done to make code hard to read (such as string encryption). It cannot hide your source
Running code, type checking, linting, dead-code detectionNot supportedIt only formats what it can parse
Reading config files (.prettierrc, EditorConfig)Not supportedSettings come from the on-screen options only
Offline useSupportedWorks without a connection once loaded

Limits & notes

  • Input is limited to 1 million characters. Above 100,000 characters auto-run pauses and you press “Run”.
  • Formatting depends on Prettier and JavaScript minifying on Terser, so syntax they do not support yet is reported as a syntax error with its position.
  • Language detection is a heuristic. Choose the language manually if it guesses wrong.
  • HTML minifying does not interpret CSS, so elements made whitespace-sensitive by an external stylesheet (`white-space: pre`) are not detected; inline style attributes are.
  • Anything not minified is left as written (inline <script> with a non-JavaScript type, scripts that cannot be parsed).
  • Syntax coloring is approximate (not a parser) and does not affect what you copy or download.

Privacy & safety

The code you enter and any files you open are processed only inside your browser. Nothing is uploaded or stored, so confidential source is safe to format or minify. Closing the page clears everything.

FAQ

Is the result the same as Prettier?
Formatting uses Prettier 3.9.10, so the same settings give the same result. This tool does not read .prettierrc, so everything except the on-screen options (indent, width, quotes, semicolons, trailing commas) stays at Prettier’s defaults.
Can minifying change how the code behaves?
JavaScript goes through Terser’s standard compression, and tests check that the same input gives the same result before and after. Code that depends on toString() output, or on local variable names themselves (via eval or new Function), can still change. Turning off “Shorten local variable names” keeps variable names and also keeps function and class names (Function.prototype.name).
Can TypeScript be minified?
No. Stripping types needs a compile step that this tool does not do. Convert to JavaScript with tsc or esbuild first, then minify it as JavaScript. Formatting TypeScript works.
Does HTML minifying break <pre>?
No. The contents of <pre>, <textarea> and elements with an inline white-space rule are not touched at all. Runs of whitespace in normal text become one space, which renders the same in HTML. &nbsp; is not treated as whitespace and stays as it is.
Does it obfuscate code?
No. Local names are shortened, but nothing is done to make the source unreadable. Code you ship to clients can be turned back into something close to the original with any formatter.
Is my code sent to a server?
No. Formatting and minifying run in your browser (in a Web Worker); nothing is sent to LIBRA Works or any third party.

Diff Tool — Text & Code Compare

Paste or drop two versions and see added and removed lines, plus the exact words that changed inside each line. Copy or save the result as a unified patch. Nothing leaves your browser.

UUID / ULID / NanoID / Token Generator

A UUID is ready the moment the page opens. Switch to UUID v7, ULID, NanoID or a random token, generate up to 10,000 at once and save them as .txt, .csv or .json. Paste an existing UUID or ULID to read its embedded time and version.

Regex Tester

Type a pattern and matches light up in the test string instantly. Capture groups, replacement output and what each part of the pattern means are all on one screen — and patterns that would freeze your browser are stopped after one second.

JSON Studio — Formatter & Validator

Paste JSON to format, minify or validate it instantly. Errors are shown with the exact line, column and cause, and comments or trailing commas can be auto-repaired. Your data never leaves your device.

XML Studio — Formatter & Validator

Paste XML to format, minify or validate it. Errors show the exact line, column and cause, and whitespace that carries meaning (mixed content, xml:space) is never touched. XPath search and JSON conversion are on the same screen. Your data never leaves your device.

YAML / TOML Studio — Validate, Format & Convert

Paste YAML, TOML or JSON to validate, format or convert it. Errors show the exact line and column, and type traps such as “no becomes false” and anything lost in conversion are flagged up front. Your data never leaves your device.

Last updated: