# JSON to Markdown converter

> Open a .json file and get a Markdown document with the data validated, pretty-printed with two-space indentation, and wrapped in a json code block, ready for docs, issues, or prompts.

Source: https://markdownlens.ayushdev.com/json-to-markdown · Updated 2026-11-12 · Markdown Lens, free and open source: https://github.com/ayushhagarwal/markdown-lens

Parsing and formatting run in the browser so API dumps, config files, and export payloads stay on the device.

Open the converter: https://markdownlens.ayushdev.com/json-to-markdown (drop a JSON file on the page; it is processed in your browser and not uploaded).

## Steps

1. Choose a .json file.
2. Markdown Lens validates and pretty-prints it locally.
3. Copy or export the fenced Markdown.

## Example: JSON converted to Markdown

Input: `release.json` (Minified JSON)

- `{"name":"release-notes","version":"2.4.0","tags":["markdown","export"],"draft":false}`

Markdown output:

````markdown
# release

```json
{
  "name": "release-notes",
  "version": "2.4.0",
  "tags": [
    "markdown",
    "export"
  ],
  "draft": false
}
```
````

## What the converter preserves

- Valid JSON structure
- Pretty-printed indentation
- Unicode text
- A document title from the filename

## Limitations

- Invalid JSON is rejected rather than repaired.
- JSON is not turned into a table automatically.
- Very large payloads may be easier to inspect in a dedicated JSON viewer.

## How to turn JSON into a Markdown table

This converter keeps JSON as a code block so nested objects stay intact. If your JSON is a flat array of objects and you want a table, convert it to CSV first and then open the CSV here. With jq installed, this command writes the CSV:

```
jq -r '(.[0] | keys_unsorted) as $keys | $keys, (.[] | [.[$keys[]]]) | @csv' data.json > data.csv
```

- [Then convert the CSV to a Markdown table](https://markdownlens.ayushdev.com/csv-to-markdown)

## When to use a JSON code block in Markdown

- Documenting API request and response examples in a README.
- Sharing a config file in a GitHub issue or pull request.
- Pasting structured data into an LLM prompt with clear boundaries.

## Frequently asked questions

### Is JSON uploaded?

No. The file is parsed and formatted in the browser.

### Does it convert JSON into tables automatically?

No. This release pretty-prints JSON as a fenced code block so nested structures stay intact. For a table, convert flat JSON to CSV first and use the CSV converter.

### What happens with invalid JSON?

The file is rejected with an error instead of being guessed at, so you can fix it at the source.

## Related

- [CSV to Markdown converter](https://markdownlens.ayushdev.com/csv-to-markdown): Convert tabular text files into GitHub-flavored tables.
- [XML to Markdown converter](https://markdownlens.ayushdev.com/xml-to-markdown): Validate and pretty-print XML locally.
