How to Read a Minified JSON File on Android
You open a .json file and it is one endless line - no spaces, no line breaks, just
thousands of characters running off the edge of the screen. That is minified JSON. The
data is fine; it has simply had all its whitespace removed. This guide explains why that happens and
how to expand it back into something readable on an Android phone.
Short version: open the file in a JSON viewer that pretty-prints automatically. It restores the indentation and shows the data as a tree you can actually navigate.
What minified JSON looks like
Minified JSON packs everything onto one line:
{"order":{"id":8842,"items":[{"sku":"A1","qty":2},{"sku":"B7","qty":1}],"paid":true}}
The readable version of the exact same data looks like this:
{
"order": {
"id": 8842,
"items": [
{ "sku": "A1", "qty": 2 },
{ "sku": "B7", "qty": 1 }
],
"paid": true
}
}
Expanding a minified file back into the second form is sometimes called "unminifying" or "beautifying". Nothing about the content changes - only the whitespace that makes it legible.
Why JSON gets minified in the first place
Whitespace takes up bytes, and for data that is meant to be read by machines those bytes are wasted. So APIs, analytics exports, app backups and config files routinely strip every optional space and newline to keep the payload small and fast. It is normal and correct - it is just not meant to be read by a person in that state.
A basic text preview or note app will show a minified file exactly as it is stored: one long line. Some editors also struggle to wrap or scroll a single line that is tens of thousands of characters long, which is why the file can feel like it "won't open" even when it opened fine.
How to read a minified JSON file on Android, step by step
1. Install a JSON viewer
Install JSON Viewer from Google Play. It is free and needs no account.
2. Open the minified file
Tap Open JSON File and choose the file from the Android document picker - from storage, Downloads, or another app. If the minified JSON is on your clipboard rather than saved as a file, paste it instead, or load it from a URL.
3. Read the expanded structure
The viewer pretty prints the minified JSON automatically, restoring indentation and line breaks. It opens as a tree view, so instead of scrolling one giant line you expand and collapse objects and arrays to move through the data. Long-press a node to inspect its keys, values and path.
Working through a large minified file
Minified files are often big, because minifying is exactly what you do to a file you want to keep small. Once it is expanded:
- Collapse the top-level nodes and open only the branch you care about.
- Search inside the content to jump straight to a key or value.
- Bookmark nodes you need to return to, so you are not re-scrolling.
If it still won't open
If a supposedly minified file refuses to display, it may not be valid JSON, or it may be truncated - a download that stopped early leaves the JSON incomplete, and incomplete JSON cannot be parsed. Re-download or re-export it from the original source and try again.
The app behind this guide
JSON Viewer is my own Android app, and it is what the steps above describe. It pretty prints minified JSON automatically, lays it out in a clean tree view you can expand and collapse, searches inside the content, holds up with large files, and has a dark mode. The core viewer is free and needs no account.
An optional Pro unlock adds very large file support, JSONPath search, copying node paths, saved bookmarks, and saving, sharing or exporting the formatted result.
