What it does
This tool tidies code that is squashed onto a few lines, or shrinks code that is already tidy. For HTML, CSS and JavaScript it can beautify (add indents and line breaks so people can read it) or minify (remove comments and extra spaces so the file is smaller). It tells you how many bytes were saved.
It works on the text only. It never runs your code and sends nothing anywhere, so it is safe for scripts you have not read yet. To tidy JSON or SQL instead, use JSON formatter or SQL formatter; to turn a table into Markdown, try markdown table maker.
How to use it
- Paste your code. The example is already there.
- Leave Language on “Find out for me”, or pick HTML, CSS or JavaScript if the guess is wrong.
- Choose the indent, then press Beautify or Minify.
- Press Copy result or Download.
What each setting does
- Language: the automatic choice looks at how the text begins. An HTML file may hold CSS in a style tag and JavaScript in a script tag; those parts are formatted with the CSS and JavaScript rules.
- Indent: 2 spaces, 4 spaces or a tab for each level.
- Beautify: HTML tags go on their own lines; short inline pieces such as bold text stay with their sentence. CSS gets one property per line. JavaScript gets one statement per line, with spaces around operators. Lines the code might depend on (no semicolon) are kept.
- Minify: removes comments and white space. Text inside
preandtextarea, and inside strings, is not touched.
Worked example
The example is a small HTML card of 263 bytes with a comment, extra spaces, a style block and a script. Beautified it becomes 23 lines (359 bytes). Minified it is 232 bytes, which is 31 bytes saved, about 12% smaller.
FAQs
Is minified code safe to use? The minifier only removes spaces and comments, and keeps a line break wherever JavaScript could rely on one. Test the result before you publish, as you would with any tool. For a big site, a build tool does a deeper job by also shortening names.
Does it check for mistakes? No. It lays out what you give it. A missing bracket stays missing.
Why did my regular expression or template string not change? Strings, regular expressions and template literals are copied as they are, so the code means the same thing afterwards.
Is anything uploaded? No. Everything happens on your device and works offline once the page has loaded.
Where the numbers come from
- fibub's own simple formatters for HTML, CSS and JavaScript. They change white space and comments only. They were checked by beautifying and minifying 80 real JavaScript files and confirming each result still parses. They are not a replacement for a build tool such as Terser or esbuild when you ship a large app.
Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.
Last updated 2026-12-05.