# Convert JSON to MD for your agents

> Source: <https://dev.to/rajnandan1/convert-json-to-md-for-your-agents-2j4k>
> Published: 2026-08-25 09:12:07+00:00

Convert one JSON document into deterministic, human-readable [GitHub Flavored Markdown](https://github.github.com/gfm/).

Runs in the browser, in Node, in Go, and on the command line.

Output is a readable **projection** rather than a reversible serialization format. Every document begins with a `# Results`

heading (replace or omit it via the `heading`

option), leaves values bare unless `showTypes: true`

opts into type annotations — `42 *(integer)*`

— and uses canonical spacing: LF endings, one blank line between blocks, no trailing spaces, one final newline.

If you feed JSON into an LLM, you pay for its punctuation. Every `{`

, `}`

, `"`

,

`:`

, and `,`

is tokens spent on structure the model does not need to read the

data. Converting the same document to Markdown headings and lists is measurably

cheaper and easier for models to follow:

Convert one JSON document into deterministic, human-readable [GitHub Flavored Markdown](https://github.github.com/gfm/).

The same conversion runs in the browser, in Node, in Go, and on the command line. The TypeScript and Go implementations produce **byte-identical output**, enforced by a shared [ corpus/](https://github.com/rajnandan1/json-to-md/corpus/) and a cross-implementation fuzz gate in CI. Output is a readable

`# Results`

heading (replace or omit it via the `heading`

option), leaves values bare unless `showTypes: true`

opts into type annotations — `42 *(integer)*`

— and uses canonical spacing: LF endings, one blank line between blocks, no trailing spaces, one final newline.If you feed JSON into an LLM, you pay for its punctuation. Every `{`

, `}`

, `"`

`:`

, and `,`

is tokens spent on structure the model does not need to read the
data. Converting the same document to…
