DT Dev Tools

CSV to TOON Converter

Convert CSV to TOON (Token-Oriented Object Notation) online to cut LLM prompt tokens. Paste or drop a CSV file and get compact, typed TOON. Free, private, in your browser.

πŸ”’ Runs entirely in your browser β€” nothing is uploaded

Drop a .csv / .tsv file here, or click to choose

Advertisement

Turn spreadsheets into token-efficient TOON

When you send tabular data to ChatGPT, Claude, Gemini or a local model, every token costs money and context window. JSON repeats every field name on every row and adds braces, quotes and commas; raw CSV is compact but loses structure, types and the guarantee of how many rows there are. TOON (Token-Oriented Object Notation) sits in between: it encodes the same data model as JSON, but writes a uniform array once as a table header such as rows[3]{id,name,email}: followed by one compact line per row. This CSV to TOON converter does that transformation in your browser using the official TOON library.

Paste CSV, drop a .csv or .tsv export from Excel, Google Sheets or a database, or load the sample. The delimiter is detected automatically and quoted cells with commas or line breaks are parsed correctly. The output is ready to paste into a system prompt, a RAG context or an agent tool response.

Types, nesting and options

With Detect numbers & booleans on, values like 42, 3.5 and true are written as real TOON numbers and booleans and empty cells become null, while ZIP codes with leading zeros and long IDs stay as text. Nest dotted headers turns columns like address.city into nested objects. The Wrap in key field names the array (rows[3]{…}:); clear it to emit a root-level array. Switch the TOON delimiter to tab or pipe when your cells contain many commas β€” it avoids quoting and often saves even more tokens.

Tips for using TOON with LLMs

Tell the model the data is TOON and that [N] is the row count; when asking for TOON back, show a header for the format you expect. Decode and validate the model's reply with TOON to JSON in strict mode, or turn it back into a spreadsheet with TOON to CSV. Need other formats from the same sheet? Try CSV to JSON, CSV to YAML or CSV to XML. Nothing is uploaded β€” your data stays on your device.

How to use

  1. Add your CSVPaste CSV or TSV text, drop a .csv file, or click Load sample. The delimiter is detected automatically.
  2. Choose TOON optionsSet the wrapping key (or leave it empty for a root array) and pick a comma, tab or pipe delimiter.
  3. Use it in your promptCopy the TOON into your LLM prompt or download it as a .toon file.

Frequently asked questions

What is TOON?
TOON (Token-Oriented Object Notation) is a compact, human-readable encoding of JSON data designed for large language models. Uniform arrays of objects are written once as a header like rows[3]{id,name}: followed by one line per row.
How many tokens does TOON save compared with JSON?
For tabular data it typically uses 30–60% fewer tokens than pretty-printed JSON, because field names are written once instead of on every row and braces and quotes disappear.
Why convert CSV to TOON instead of pasting CSV?
TOON keeps the row count ([N]) and field list explicit, supports nested objects and types, and can be decoded back to exact JSON, so models make fewer structural mistakes and you can validate their answers.
Which delimiter should I choose?
Comma is the default. Tab often tokenizes even better and avoids quoting when cells contain commas; pipe is a readable alternative.
Is my data uploaded?
No. CSV parsing and TOON encoding run entirely in your browser with the official @toon-format/toon library.
Advertisement