Skip to main content

Command Palette

Search for a command to run...

Today I learned about JSONL format

Updated
1 min read
Today I learned about JSONL format
P

Full-stack web developer with a taste for Laravel, Docker, and a few more components in the ecosystem

Fun fact, while deep diving how Claude Code works, I realised some files were stored with a .jsonl format! What’s this, a typo?? 😀 Of course not….

It's a text format where each LINE is a valid JSON object. So why this and not just a JSON array?!

Regular JSON - one big array

[
    {"id": 1, "name": "Alice"},
    {"id": 2, "name": "Bob"}
]

JSONL - one object per line

{"id": 1, "name": "Alice"}
{"id": 2, "name": "Bob"}

Why?

- Logs and "file as database" -> just append!

- Reading with stream: we can parse each line, one by one, immediately! A slightly different array of objects!

And much more possibilities, I’m sure!

There are some things to take in consideration:

  • Not human-readable at a glance (no pretty formatting)

  • Can't have relationships between lines easily

  • Harder to edit manually

  • Less tooling support than regular JSON

I hope you enjoyed this nugget!! Happy coding!