mygems

How to open a JSON file on iPhone and iPad (2026 guide)

iOS shows a JSON file as one unreadable line of text. Here is how to read it properly on iPhone and iPad, from the free Files preview to a real editor.

By mygems ·

Tap a .json file on an iPhone and you get one of two things: a wall of text with no line breaks, or nothing at all. iOS knows a JSON file is text. It has no idea it is structured text, so it shows you the bytes and leaves the braces to you.

That is fine for a ten-line config file and useless for an API response. Here are the ways to actually read one on iPhone and iPad, from free and built in to a proper editor.

The fast answer

  • Small file, just need a look: the Files app preview. Free, built in, no formatting.
  • Need it readable: a code editor app that pretty-prints, or a JSON app with a collapsible tree.
  • Need to change it and save it back: a JSON editor that validates as you type, so you can't save a file that no longer parses.
  • Don't paste anything with a token, key or customer data into a random "JSON formatter" website.

First, getting the file onto the phone

Most JSON on a phone arrives one of three ways, and each lands somewhere different:

  • Email attachment: tap it, then the share button, then Save to Files. Until you do, it lives inside Mail and most apps can't see it.
  • AirDrop from a Mac: goes to Downloads in Files, or straight into an app if you pick one from the AirDrop sheet.
  • A URL: an API endpoint opened in Safari shows as raw text. Long-press and save the page, or, simpler, use an app that can fetch a URL directly.

Route 1: the Files app preview

Open Files, find the file, tap it. Quick Look shows it as plain text.

Where it breaks: almost immediately, for real-world JSON. Most API responses and exported files are minified: the whole document is one line, so Quick Look wraps it into a dense paragraph with no indentation. There is no search inside the preview worth the name, no folding, and no way to edit.

It answers "is this the file I think it is?" and nothing else.

Route 2: a code editor

A general-purpose code editor treats JSON as one language among many: syntax colouring, line numbers, and usually a format or "pretty print" command that turns the one long line into an indented document.

Runestone is a good free one on iOS; Textastic is the long-standing paid option. Both open files in place from Files.

Where it breaks: a code editor shows JSON as text. On a phone screen, a 2,000-line indented document is a lot of scrolling to find one value eight levels deep. You also get no help when you break the syntax: a missing comma looks like any other character until something downstream refuses the file.

Route 3: a JSON app

The difference a dedicated app makes is that it understands the structure: it can show you the document as a tree of keys you expand and collapse, tell you exactly where it's invalid, and let you search keys and values instead of text.

An order document shown as a collapsible tree: root, order, id, status, customer with name, email and address, and an items array
The same file as a tree
The same order document drawn as a node-link graph branching left to right
And as a graph

On iPhone and iPad, Smart Json opens a document three ways at once: the text, a tree, and a graph, all of which edit. It opens files from Files and iCloud Drive, accepts JSON from any app's share sheet, and can start a document from the clipboard or fetch it from a URL, with your own request headers if the API needs them.

JSON Editor: Smart JsoniPhone & iPad

Opens a JSON file as syntax-highlighted text, a searchable tree and a tappable graph, flags invalid JSON with the line and column, and works offline.

What it does

That's our app, so discount the recommendation accordingly. The comparison above is the part that has to hold up on its own.

The online formatter trap

Searching "JSON viewer" on a phone leads to websites that format whatever you paste into them. For public data they're fine. For anything else, think about what you are pasting:

  • API responses often carry access tokens, session IDs or API keys.
  • Exported data often carries names, emails and addresses.
  • Some of these sites offer "save" or "share" links that store what you pasted on their server, and security researchers have found large numbers of those saved snippets, credentials included, publicly retrievable.

A local app costs nothing in exposure. If you must use a website, pick one that formats in the browser without uploading, and never use its save feature.

If the file won't open, or opens wrong

  • "Invalid JSON" or a blank view: the file is malformed, often by one character. The invalid JSON guide goes through every common error.
  • Curly quotes in a file you typed on the phone: iOS's Smart Punctuation replaces " with “ as you type, and JSON only accepts the straight one. Turn it off under Settings → General → Keyboard → Smart Punctuation before editing JSON by hand.
  • It's actually .jsonl or NDJSON: one JSON object per line, not one document. Most viewers expect a single document and will report an error at the start of line two.
  • It's huge: a native app copes with far larger files than a web page or a text preview, which tend to freeze first. If the file is tens of megabytes, open it in an app rather than a browser tab.

On an iPad

Everything above applies, with two improvements worth using. Split View lets you keep the JSON beside the app or browser you're debugging, and a hardware keyboard makes hand-editing realistic: a JSON editor with keyboard shortcuts for find and undo is close to working on a laptop.

Questions

How do I open a JSON file on my iPhone?
Save it to the Files app and tap it: Quick Look shows the contents as plain text. That is enough for a short file. For anything longer, use a code editor that can pretty-print it, or a JSON app that shows the structure as a collapsible tree.
Why does my JSON file show as one long line on iPhone?
Most JSON from APIs and exports is minified: all whitespace removed to save bytes, so the whole document is a single line. iOS shows it exactly as written. A formatter or JSON app re-indents it for reading without changing the data.
Can I edit a JSON file on iPhone?
Yes, with a code editor or a JSON editor app. A JSON editor is safer because it validates as you type and tells you where the document broke. Turn off Smart Punctuation first, or iOS will insert curly quotes that make the JSON invalid.
Is there a free JSON viewer for iPhone?
The Files app preview is free and built in but does not format. Free code editors such as Runestone can pretty-print JSON. Dedicated JSON apps, ours included, generally have free versions for reading and editing.
Is it safe to use an online JSON formatter?
For public data, yes. For API responses or exports, be careful: they often contain tokens, keys or personal data, and some formatter sites store what you paste when you use their save or share features. Prefer a tool that works locally.

mygems — Builds Smart Json, a JSON editor for iPhone and iPad that shows one document as text, a tree and a graph.