Code Formatter
Beautify or minify HTML, CSS, JavaScript, SQL, XML, JSON, PHP, YAML, INI, CSV, TOML or .env code. Paste up to 200,000 characters or fetch a public URL, then copy or download the result.
Formatting changes layout, not correctness. It is not a linter, compiler or syntax checker, and manual input is processed on the server.
Uso Code Formatter
Resultado
Leer el contenido
Code Formatter
What this code formatter does
This page formats or minifies code in twelve languages: HTML, CSS, JavaScript, SQL, XML, JSON, PHP, YAML, INI, CSV, TOML and .env. Choose a language, choose Beautify or Minify, paste the code or fetch it from a public URL, and run the formatter. The output appears in a read-only editor that you can copy or download. It is a formatting utility, not a compiler, linter or syntax checker.
Beautify versus minify
Beautify adds indentation and line breaks so the structure is easier to read. Minify removes unnecessary whitespace and, depending on the language, may shorten the output for production. The two modes serve different purposes. Use Beautify when you are reviewing or debugging code. Use Minify when you need a smaller payload and you have a safe copy of the original. Always test minified JavaScript or CSS before deploying it.
Supported languages
The language menu covers HTML, CSS, JavaScript, SQL, XML, JSON, PHP, YAML, INI, CSV, TOML and .env. Each language has its own server-side formatting routine, so the result can differ from a dedicated tool such as Prettier or a database formatter. The page does not switch language automatically from the content. If you paste JavaScript while HTML is selected, the output may be formatted with the wrong rules.
How to use the manual editor
Select the language and mode. Paste the code into the editor. Press the format button and wait for the server response. The formatted result replaces the output panel. Use the copy button to put it on the clipboard, or the download button to save a file with an extension based on the mode and language. The input limit is 200,000 characters, so very large bundles should be split or processed with a command-line tool.
Fetching code from a URL
The URL tab asks the server to fetch a public address and format the response. The URL must return the code directly, not a login page or a JavaScript-rendered shell. A private address, an authenticated endpoint or a host that blocks automated requests will fail. The server also enforces the 200,000-character limit after fetching. Use the manual editor for private code or anything behind a login.
What the output can and cannot do
The formatter changes layout, not behaviour. It does not fix syntax errors, resolve imports, validate SQL against a schema or check that HTML is accessible. Beautify can make malformed code easier to inspect, but it will not repair it. Minify can expose a missing semicolon or an accidental global. Keep a version-controlled copy of the original and compare the output before replacing production files.
Language-specific caveats
HTML and XML formatting can change whitespace that matters inside inline elements or text nodes. CSS minification can alter a value if the input is already unusual. JavaScript minification can break code that relies on function names, `eval` or exact source text. SQL formatting is cosmetic and may not match your database dialect. CSV is a data format; a formatter may change quoting or delimiters, so inspect the result before importing it.
CSV, INI and .env files
These are not programming languages in the usual sense. CSV depends on quoting rules, INI depends on sections and comments, and .env depends on line-based key-value parsing. A generic beautifier can make them easier to read but may not preserve every convention. For CSV, check the delimiter and quoted fields. For INI, check that comments and section headers survive. For .env, check that values containing spaces or `#` are still interpreted as intended.
Privacy and server processing
The manual editor sends your code to the Newisty server for formatting. Do not paste production secrets, API keys, private keys or customer data unless you accept that transmission. The URL fetch also happens on the server, so the remote host sees the request. Local formatting with a command-line tool is a better choice for confidential source code or regulated data.
Common problems
If the output is empty, check that the input is not empty and that the selected language matches the content. If a URL fetch fails, open the URL in a private window to confirm it returns raw code. If the result looks wrong, try Beautify instead of Minify and inspect the first few lines. If the request is rejected, the input may exceed 200,000 characters. If the page times out, split the file.
When to use it
Use it for a quick cleanup of a snippet, a configuration file or a response body. It is convenient when you do not have a local formatter installed. For a team project, use the formatter configured in the repository so the output matches the project's style. For a production build, use the bundler's minifier rather than pasting a bundle into a web page.
What not to do
Do not treat formatted code as validated code. Do not paste secrets or private source into a public tool. Do not assume a generic CSV or INI formatter preserves every convention. Do not deploy minified output without testing. Do not rely on the page to enforce your project's style guide. Do not use URL fetch to bypass a login or access a private endpoint.
Formatting a snippet safely
Keep a copy of the original before you replace anything. Format the smallest complete unit you can: a function, a style rule, a query or a config file. If the output looks wrong, compare the first and last lines with the source. A formatter should not silently delete code, but a language mismatch can produce nonsense. For JavaScript, run a syntax check or a test after formatting. For SQL, run an EXPLAIN in a safe environment rather than assuming the query still means the same thing.
What each data format becomes after processing
For several formats the server reads the input into data and writes it out again, rather than only adjusting whitespace. Knowing what that rewrite does avoids surprises:
| Language | Beautify | Minify | Watch for |
|---|---|---|---|
| JSON | 4-space indentation | One line | Non-English characters come back as \u escape codes, and an empty object {} can come back as [] |
| YAML | 2-space indentation | Compact inline style | Comments are dropped |
| TOML | Rebuilt from parsed data | Same as Beautify | Comments are dropped |
| INI | key = value per line | key=value per line | [section] headers and comments are removed; a key repeated in two sections keeps only the last value |
| CSV | Aligned table with | between columns | Compact comma-separated rows | Beautified output is for reading and is no longer a valid CSV |
| .env | Trims spaces around keys, values and = | Same as Beautify | Comments are kept |
For a sectioned INI file, keep your original and use the output only to read the values. For CSV you plan to import, use Minify.
Download file names
The Download button names the file after the mode and the language's usual extension, for example beautify-output.json, minify-output.js, beautify-output.yml or minify-output.env. Rename it before saving it over a real file, and make sure the Language menu matched the content, because the extension comes from the menu, not from the code.
Frequently Asked Questions
Preguntas frecuentes
Comentarios (0)
Describe el problema que has tenido para que podamos investigarlo y mejorar la herramienta.