HTML, CSS & JavaScript Formatter (Prettier)
Beautify HTML, CSS, JavaScript, TypeScript and JSON with Prettier, running entirely in your browser. Free, no sign-up, and your files never leave your device.
Free, with no sign-up and no watermark. The file is processed in your browser and never uploaded.
Beautify HTML, CSS, SCSS, Less, JavaScript, TypeScript, JSON, Markdown and YAML using Prettier — the same formatter many teams use in their editors — running entirely in your browser. Choose indentation, line width and, for JavaScript, semicolons and quote style.
Step by step
- Choose the language: Pick it from Language; the sample changes to match.
- Paste code: Or open a file.
- Adjust style: Indent, Line width, and for JS/TS Semicolons and Single quotes.
- Copy or download: The formatted code updates as you type.
Handy for
Minified code
Make third-party or minified code readable.
Emails and templates
Tidy hand-written HTML templates.
Consistent style
Apply Prettier style without installing anything.
Snippets for docs
Format code before pasting it into documentation.
Good to know
Syntax errors are reported with line and column — Prettier refuses to format code it can't parse.
HTML formatting also formats embedded
<style>and<script>blocks.The formatter downloads once (a few hundred KB) the first time you use it, then works offline.
Questions
Will it change how my code behaves?
Prettier only changes formatting. In HTML, whitespace between inline elements can matter visually; Prettier is careful to preserve meaningful whitespace.
Is my data sent anywhere?
No. Everything is processed by JavaScript in your browser tab — nothing you paste or open is uploaded, logged or stored on a server. You can even use the tool offline once the page has loaded.
More Developer Tools tools
- JavaScript, CSS & HTML Minifier — Minify JavaScript with Terser, CSS and HTML safely, and see exactly how many bytes you saved.
- Base64 Encoder & Decoder — Encode and decode Base64 for UTF-8 text and any file, including the URL-safe variant.
- Image to Base64 Converter — Convert images into Base64 data URIs with ready-to-paste HTML and CSS snippets.
- Base64 to Image Converter — Paste a Base64 string or data URI to preview the image, detect its type and download it.
- URL Encoder & Decoder — Percent-encode or decode URLs and components, and break query strings into an editable table.
- HTML Entity Encoder & Decoder — Escape text into HTML entities (named or numeric) and decode entities back to characters.