<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/introduction-to-toon-format-in-java-nta2gzrtp" -->

---
title: Introduction to TOON Format in Java | daily.dev
description: TOON (Token-Oriented Object Notation) is a compact alternative to JSON designed to reduce token consumption when sending structured data to LLMs. It uses...
canonical: https://daily.dev/posts/introduction-to-toon-format-in-java-nta2gzrtp
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Introduction to TOON Format in Java | daily.dev
og:description: TOON (Token-Oriented Object Notation) is a compact alternative to JSON designed to reduce token consumption when sending structured data to LLMs. It uses...
og:url: https://daily.dev/posts/introduction-to-toon-format-in-java-nta2gzrtp
og:image: https://api.daily.dev/og/posts/NTA2gZrTp.png
og:image:alt: Introduction to TOON Format in Java
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction to TOON Format in Java

**[Baeldung](https://daily.dev/sources/baeldung)** · 9 min read · 4 upvotes · 1 comments

## Summary

TOON (Token-Oriented Object Notation) is a compact alternative to JSON designed to reduce token consumption when sending structured data to LLMs. It uses indentation instead of braces, minimal quoting, and a tabular layout for uniform collections that states field names once rather than repeating them per object. Two Java libraries support TOON: JToon and json-io. Using json-io, you can serialize Java objects with JsonIo.toToon() and deserialize with JsonIo.fromToon(). Benchmarks using OpenAI's BPE tokenizer show 24-44% token savings for collections compared to JSON, with savings growing as collection size increases. For flat data, TOON is within 6% of CSV efficiency while also handling nested structures CSV cannot represent. A Spring AI starter (json-io-spring-ai-toon) enables automatic TOON conversion for tool call results via a ToonToolCallResultConverter annotation. TOON is best suited for LLM tool results, RAG payloads, and agentic workflows where token cost and context window size matter.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://feeds.feedblitz.com/~/950982251/0/baeldung~Introduction-to-TOON-Format-in-Java>

## Community discussion

Top comments from developers on daily.dev.

**@asyd** · 0 upvotes

> wonder how much this will be adopted

## Similar posts on daily.dev

- [What is TOON? How Token-Oriented Object Notation Could Change How AI Sees Data](https://daily.dev/posts/what-is-toon-how-token-oriented-object-notation-could-change-how-ai-sees-data-cbe3uttgn) · freeCodeCamp · 5 upvotes · 1 comments

---

Tags: [#java](https://daily.dev/tags/java), [#llm](https://daily.dev/tags/llm), [#spring-ai](https://daily.dev/tags/spring-ai)

[View this post on daily.dev](https://daily.dev/posts/introduction-to-toon-format-in-java-nta2gzrtp)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Introduction to TOON Format in Java","url":"https://daily.dev/posts/introduction-to-toon-format-in-java-nta2gzrtp","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/introduction-to-toon-format-in-java-nta2gzrtp"},"datePublished":"2026-03-18T13:52:43.244Z","dateModified":"2026-03-18T13:55:34.651Z","description":"TOON (Token-Oriented Object Notation) is a compact alternative to JSON designed to reduce token consumption when sending structured data to LLMs. It uses...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d44a07f075d9c6bbf1c118f4c9a6366c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d44a07f075d9c6bbf1c118f4c9a6366c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Baeldung","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Baeldung","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576","url":"https://daily.dev/sources/baeldung"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/introduction-to-toon-format-in-java-nta2gzrtp","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"java,llm,spring-ai","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Baeldung","item":"https://daily.dev/sources/baeldung"},{"@type":"ListItem","position":3,"name":"Introduction to TOON Format in Java"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/introduction-to-toon-format-in-java-nta2gzrtp","comment":[{"@type":"Comment","text":"wonder how much this will be adopted","datePublished":"2026-03-19T08:17:43.475Z","url":"https://daily.dev/posts/NTA2gZrTp#c-K7BdMM3Zd","author":{"@type":"Person","name":"Jakub Michalik","url":"https://daily.dev/asyd","image":"https://avatars.githubusercontent.com/u/44025800?v=4"}}]}
```

