Code Beautifier & Formatter
Format and prettify code in 12 languages — JavaScript, TypeScript, HTML, CSS, JSON, YAML, and more. Powered by Prettier with full option control.
Supported Languages
- JavaScript & JSX — ES2023+, React JSX, modern syntax including optional chaining and nullish coalescing.
- TypeScript & TSX — Full TypeScript including generics, decorators, and React TSX components.
- HTML — Full HTML5 with inline script/style blocks, attributes, and custom elements.
- CSS / SCSS / Less — All three stylesheet languages including variables, nesting, mixins, and media queries.
- JSON — Pretty-print with configurable indentation and compact output.
- Markdown — CommonMark-compliant formatting including tables, lists, and front matter.
- YAML — Block and flow style formatting with consistent indentation.
- GraphQL — Schema definitions, queries, mutations, and fragments.
Formatting Options
Click Options ▼ to configure how code is formatted:
- Tab width — 2 or 4 spaces (or real tabs).
- Print width — where Prettier wraps long lines (80, 100, 120, or 140 characters).
- Quotes — single or double quotes for JS/TS string literals.
- Semicolons — add or omit trailing semicolons in JS/TS.
- Trailing commas — none, ES5-compatible, or everywhere (including function parameters).
- Arrow parens — always wrap single-argument arrow functions, or avoid parens when possible.
- Bracket spacing — spaces inside object literal braces:
{ foo: bar }vs{foo: bar}. - End of line — LF (Unix/macOS), CRLF (Windows), or auto-detect.
How to Use
- Select a language from the chips at the top — or paste code and click Auto-detect.
- Optionally open Options to adjust formatting preferences.
- Paste your code in the Input panel on the left.
- Click Format or press Ctrl+Enter (Cmd+Enter on Mac).
- Copy the result, download it, or click Use to make the output the new input for another pass.
Everything runs locally in your browser — no code is ever sent to a server.
Related Tools
SQL Formatter
Prettify or minify SQL queries with automatic keyword uppercasing, clause indentation, and newlines.
JSON to TypeScript
Convert JSON to TypeScript interface or type alias definitions recursively. Handles nested objects, arrays, and null values.
.gitignore Generator
Pick your tech stack and get a ready-made .gitignore file with all standard exclusions per technology.
String Escape Tool
Escape or unescape strings for JavaScript, JSON, HTML, Regex, URL, and CSS in one click.
HTML Entity Encoder
Encode or decode HTML entities — convert special characters to & references and back.
JWT Decoder
Decode and inspect JSON Web Tokens — header, payload, and expiry — without a secret.
Cron Expression Explainer
Parse and explain cron expressions in plain English. Shows next 5 run times.
HTML Formatter
Prettify or minify HTML with configurable indentation and syntax-highlighted output. Nothing sent to any server.
Byte Converter
Convert between bytes, KB, MB, GB, TB and binary (KiB, MiB, GiB) equivalents. Covers both decimal (SI) and binary (IEC) prefixes.
XML Formatter
Prettify or minify XML with configurable indentation and syntax highlighting.
Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 strings back to text. Handles UTF-8 and Unicode — instant, no server.
Diff Checker
Compare two pieces of text and see the differences highlighted. Line-by-line diff with added/removed lines clearly marked.
JSON Formatter & Validator
Format, pretty-print, and validate JSON with customizable indentation and key sorting. Instant feedback on syntax errors.
JSON to CSV Converter
Convert a JSON array to CSV format. Customizable delimiter, header row, and field quoting. Download as .csv.
Number Base Converter
Convert numbers between binary (base 2), octal (8), decimal (10), and hexadecimal (16) instantly.
Regex Tester
Test and debug regular expressions against sample text. See all matches, capture groups, and flags explained.
SHA Hash Generator
Generate SHA-1, SHA-256, SHA-384, and SHA-512 cryptographic hashes from text or files. Computed locally in your browser.
Unix Timestamp Converter
Convert Unix timestamps to human-readable dates and times, or convert any date to its Unix timestamp.
URL Encoder & Decoder
Percent-encode URLs and query strings, or decode URL-encoded strings back to readable text.
HTML to Markdown Converter — Free Online
Convert HTML to Markdown and Markdown to HTML online. Supports headings, lists, links, tables, code blocks, and more.
YAML Formatter & YAML to JSON Converter — Free Online
Format and validate YAML online. Convert YAML to JSON and JSON to YAML. Supports nested objects, arrays, and multi-line strings.