
Paste TOML or open a file. The compressed version shows up here as you type, checked against your original.
Runs entirely in your browser. Your TOML is never uploaded.
This TOML compressor shrinks .toml files such as Cargo.toml, pyproject.toml, Hugo and Netlify configs by removing comments, blank lines and extra spaces, and by joining multi-line arrays onto one line. Strings, numbers, dates and keys are never touched. Paste a file or open one and the result updates as you type. Each result is read back with a TOML parser and compared with your original, so you know the data is identical before you download it. If your TOML has a mistake, you’ll see the line and column.
How to compress a TOML file
- Paste your TOML into the left box, use Open file, or drag the file onto the box.
- Choose what to remove. Everything is on by default, and all of it is safe for TOML.
- Open Changes to see removed lines in red, edited lines in amber, and array lines that were joined onto the line above in blue.
- Open Check to confirm the data is unchanged, then copy, download the
.toml, or download a.gzcopy.
What each option does
| Option | What it removes |
|---|---|
| Remove comments | Everything after a # that isn’t inside a string, including whole comment lines and comments at the end of a line. |
| Remove blank lines | Empty lines between tables and keys. Blank lines inside multi-line strings are kept, because they’re part of the text. |
| Remove extra spaces | Indentation, trailing spaces, and spaces around =, commas, brackets and dots, so name = "app" becomes name="app" and [ tool . poetry ] becomes [tool.poetry]. The space inside a date like 1979-05-27 07:32:00 is kept. |
| Join multi-line arrays | Line breaks inside arrays, so a list written over many lines fits on one. If you keep comments, any line ending in a comment stays on its own line. |
Before and after
# Package details
[package]
name = "my-app"
version = "0.3.1" # bump before release
[dependencies]
serde = { version = "1.0", features = [ "derive" ] }
tokio = { version = "1", features = [
"macros",
"rt-multi-thread",
] }With every option on, that becomes:
[package]
name="my-app"
version="0.3.1"
[dependencies]
serde={version="1.0",features=["derive"]}
tokio={version="1",features=["macros","rt-multi-thread",]}What’s never changed
- Strings of every kind, including
"""and'''multi-line strings, character for character - Numbers, booleans, and dates and times exactly as written, so
1_000,0xFFand1.0stay that way - Keys, including quoted keys, and the order of every table and key
- Table headers and arrays of tables like
[[bin]] - Line endings. Files with Windows CRLF line endings keep them.
Because the tool only removes spacing and comments between values, and never rewrites the values themselves, the result works with every TOML parser your original worked with. It was tested on hundreds of real TOML files and the full official toml-test suite.
Should you use the GZIP download?
GZIP usually makes a TOML file 30–60% smaller, which helps for backups and sending configs over slow links. But Cargo, pip, Hugo and other tools can’t read a .toml.gz file directly. Unzip it first (gunzip config.toml.gz on Linux and macOS, or 7-Zip on Windows). If you need a smaller config an app can load, use the regular .toml download.
Frequently asked questions
Is it safe for Cargo.toml and pyproject.toml?
Yes. Cargo, pip, Poetry and other build tools only see the data, and the data is checked to be identical. Keep your commented original in version control, though. Comments are often the only documentation a config file has.
How much smaller will my file get?
It depends on how commented and spaced out the file is. Heavily commented configs often shrink by about half. A file that’s mostly keys and values usually loses 10–20% from spacing.
Why is download turned off?
The TOML has a syntax error, shown with its line and column, such as a duplicate table, a missing quote or a value without a key. Fix it and the result appears as you type.
Does it sort or reorder keys?
No. Tables and keys stay in the order you wrote them.
Does it support TOML 1.1?
Yes. Inline tables spread over several lines, trailing commas in inline tables and the new string escapes all work, and the check understands both TOML 1.0 and 1.1.
Is my file uploaded anywhere?
No. Everything runs in your browser, including the check and the GZIP step. Config files often contain tokens and server addresses, and none of it leaves your device.
