Developer ٹول اپ ڈیٹ ہویا 21 فَن ago

TOML Beautifier

TOML Beautifier tidies TOML on the server line by line: consistent key = value spacing, clean table and array-of-table headers, single blank lines and indented multi-line arrays. Comments, key order, inline tables and multi-line strings are kept as written. Minify strips comments and blank lines. It catches unterminated strings and unbalanced brackets but is not a full validator.

ہمیشہ مَفتی آسان استعمال فوری نتائج نجی تہٕ محفوظ

TOML Beautifier استعمال کٔرٕن

براہ راست کوڈ فائل کا یو آر ایل چسپاں کریں تاکہ اس کے مواد کو ایڈیٹر میں لوڈ کیا جا سکے۔

آؤٹ پُٹ

हो गया
ٹول لنک
کلِپ بورڈ چُھٕن کاپی تہٕ گژھ
اس ٹول کو بہتر بنانے چھی مدد کریو

مواد پڑھو

سیکھو یہ ٹول کیسے کام کَرِہٕ تہٕ کب استعمال کَرُن

About the TOML Beautifier

TOML (Tom's Obvious, Minimal Language) is a configuration format built around key = value lines. It is easy to write, which also means it is easy to write inconsistently: port=8080 on one line, host = "0.0.0.0" on the next, headers like [ server ] with stray spaces. The TOML Beautifier tidies that layout line by line: one space on each side of the first equals sign, clean table headers, a blank line before each table, and indented multi-line arrays.

It does not parse your file into data and rebuild it. Every key, value, comment and table stays where you wrote it, so it is safe for real project files with tables, arrays of tables and inline tables. The trade-off is that it is a formatter, not a full validator; the sections below explain exactly what it checks.

What gets normalised

Here is a messy but valid TOML file:

# server
name="app"
[ server ]
host   =   "0.0.0.0"  # bind
  port=8080
[[ products ]]
tags=["a","b"]

After Process Code in Beautify mode:

# server
name = "app"
 
[server]
host = "0.0.0.0" # bind
port = 8080
 
[[products]]
tags = ["a","b"]

Keys, values, comments and order are unchanged. Spacing around the equals sign is normalised, leading indentation on top-level lines is removed, spaces inside the header brackets are trimmed, a blank line is placed before each table header, and an end-of-line comment is separated from the code by one space. Notice that ["a","b"] is left as written: values on a single line are not reformatted.

Where the tool works well, and where it does not

InputResult
Top-level and table key = value pairsOne space each side of the first =; leading and trailing spaces removed
Table headers such as [server] and dotted headers such as [tool.ruff.lint]Kept, with spaces inside the brackets trimmed and a blank line before each header
Arrays of tables such as [[products]]Kept, with spaces inside the double brackets trimmed
Inline tables such as point = { x = 1, y = 2 }Kept exactly as written
Arrays that span several linesEach inner line indented by four spaces per nesting level; the closing bracket lines up with the key
Multi-line strings (""" or ''')Kept verbatim, including spacing inside the string
CommentsKept in place
Blank linesRuns of blank lines reduced to one; leading and trailing blank lines removed
Unterminated string, unbalanced brackets, or a line with no =Rejected with an error message

That makes it suitable for files such as Cargo.toml, pyproject.toml, netlify.toml or Hugo's config.toml. It is still good practice to compare the output with your input before replacing a file, especially the first time you use it.

How it runs

Formatting happens on the site's server. When you press Process Code, the page sends the editor contents, the chosen mode and the language to a PHP endpoint, which runs a line-based TOML formatter over the text and returns the result to the page; the code does not store it. The endpoint accepts up to 200,000 characters.

The URL Input tab also uses the server: it fetches the address you enter and loads the response text into the editor, cut off at 200,000 characters if the file is larger. Only use it with public, direct links to a raw TOML file.

Screen layout and controls

  • Mode: Minify or Beautify. Beautify is selected on this page. Minify removes comments, blank lines and leading and trailing spaces, but keeps one statement per line and leaves multi-line strings untouched, because TOML needs its line breaks.
  • Language: preset to TOML. The same formatter component also supports HTML, CSS, JavaScript, SQL, XML, JSON, PHP, YAML, INI, CSV and .env; changing it switches the formatter used on the server.
  • Process Code runs the formatter; Clear empties the URL field, both editors and the counters.
  • URL Input tab: Paste URL field with Paste and Submit buttons.
  • Manual Code tab: the Input Code editor with its own Paste button.
  • Output: the result, with Copy and Download. The download is named after the mode and language, for example beautify-output.toml.
  • Badges under the output show the language, the mode, and the input and output character counts.

Step by step

  1. Choose the Manual Code tab and paste your TOML into Input Code, or stay on URL Input, paste a direct link to a raw .toml file and press Submit. The file loads into the editor and the tab switches to Manual Code.
  2. Check that Language shows TOML and Mode shows Beautify.
  3. Press Process Code.
  4. If an error appears, read it. It names the line for an unterminated string or a line without =, or reports an unterminated multi-line string or unbalanced brackets. Fix the input and run again.
  5. Compare the output with your input before you replace the original file.
  6. Press Copy or Download.

Sensible uses

  • Tidying project manifests such as Cargo.toml and pyproject.toml before committing, without losing comments or key order.
  • Cleaning up pasted snippets whose indentation and spacing came from different sources.
  • Laying out long arrays: split an array over several lines and the formatter indents the items consistently.
  • Stripping comments for a compact copy with Minify, for example before embedding a config in documentation or a test fixture.

What not to do

  • Do not treat a successful run as proof that the file is valid TOML. Duplicate keys, wrong value types and malformed values are not checked.
  • Do not use Minify on a file you want to keep documented; it removes every comment.
  • Do not paste secrets. API keys and passwords in a config file are sent to the server for formatting.
  • Do not expect single-line arrays or inline tables to be re-spaced; values on one line are left as written.

Limitations

  • Formatting is line-based; it does not validate duplicate keys, value types or header names.
  • Spacing inside single-line values, arrays and inline tables is not changed.
  • Minify keeps line breaks and only removes comments, blank lines and surrounding spaces.
  • Maximum input of 200,000 characters per request; URL loads are truncated at the same length.
  • The URL loader needs a publicly reachable, direct file link and returns whatever text that address serves.

Frequently Asked Questions

عمومی سوالات

نتیجہ پر بھروسہ کرنے سے پہلے صارفین کے پوچھے گئے سوالوں کے مختصر جواب

Yes. The formatter works line by line and keeps tables such as [package] and [dependencies], arrays of tables, inline tables, comments and key order exactly as written. Compare the output with your file before replacing it.

In Beautify mode, yes: full-line and end-of-line comments stay where they are. Minify removes all comments and blank lines.

It stops with an error for an unterminated string, an unterminated multi-line string, unbalanced brackets in an array or inline table, or a line that is not a table header, a comment or a key = value pair. Line-specific errors include the line number.

Yes. The editor contents are sent to the site's server, formatted line by line, and returned to your page. The code does not save it, but avoid pasting secrets.

Beautify normalises spacing, headers, blank lines and multi-line array indentation while keeping comments. Minify removes comments, blank lines and surrounding spaces but keeps one statement per line, because TOML depends on line breaks.

On the URL Input tab, paste a direct link to the raw file and press Submit. The server fetches it, loads up to 200,000 characters into the editor and switches you to the Manual Code tab.

Only partly. It rejects unterminated strings, unbalanced brackets and lines without an equals sign, but it does not check duplicate keys, value types or header names, so a successful run is not a full validation.

The file name combines the mode and the language extension, so in Beautify mode with TOML selected it is beautify-output.toml.

تبصرے (0)

صارفین کی گفتگو، ایج کیسز، اور فالو اپ ٹِپس کے لئے
تبصرہ چھوڑو
جمع کرانے کے بعد آپ کا تبصرہ عوامی طور پر ظاہر ہوگا۔
अभी तक कोई टिप्पणी नहीं। पहली टिप्पणी करें!
ہَمُکُن بتاو!
یِمُ آلے نال مسئلہ رپورٹ کٔرٕن

जिस समस्या का आपने सामना किया उसका वर्णन करें ताकि हम टूल की जाँच और सुधार कर सकें।

سب سے زیادہ کیا مدد کرتا ہے
ان پٹ، متوقع نتیجہ، اصل نتیجہ، براؤزر/ڈیوائس اور مددگار ہونے پر اسکرین شاٹ شامل کریں۔
اسکرین شاٹ بٹن براؤزر چِ صفحہ کیپچر کٔرِتہٕ تہٕ تیار شدہ تصویر اِس فارم نال منسلک کٔرِتہٕ۔
پورے صفحے کا اسکرین شاٹ
Captured in your browser with newisty.
اَب تہٕ کٲمُتھ سکرین شاٹ کپچر نَہ مِتھ
ٹول رپورٹ