SSE / NDJSON Base64 Extractor – Free

Paste a captured streaming response and this SSE and NDJSON Base64 extractor parses every record and lists the Base64 payloads it finds, with the record number, JSON path and decoded size of each one.

How to use the SSE / NDJSON Base64 Extractor tool

  1. Under Input format, choose NDJSON for one JSON value per line, or Server-sent events for a stream with data: lines.
  2. Paste the captured stream into Event records, or select Example to load two NDJSON records.
  3. Select Extract payloads to parse the records.
  4. Read the report in the Result box. The first number in each path is the record's position, starting at 0.
  5. Select Copy, or use the Download link to keep the report as base64-values.json.

How SSE and NDJSON records are parsed

Streaming APIs deliver many small JSON documents over one connection. NDJSON, also called JSON Lines, puts one document on each line. Server-sent events, defined in the HTML standard, group lines into events separated by a blank line. The payload sits in lines that begin with data:, and other lines carry an event name, an id, a retry delay or a comment.

In NDJSON mode the tool splits the input on line breaks and parses each non-empty line. In Server-sent events mode it splits on blank lines, keeps only the data: lines of each event, removes the field name and one following space, and joins multiple data lines with a line break before parsing, as the standard prescribes. In both modes the end marker [DONE] and empty records are dropped, and Windows line endings are handled.

Worked example with an SSE capture

The capture below has an event name, a comment used as a keep-alive, an id line and the closing [DONE] marker. Only the two data payloads are parsed. They become records 0 and 1, and the block that holds only a comment does not consume a number.

event: chunk
data: {"b64_json":"SGVsbG8="}

: keep-alive

data: {"audio":{"data":"V29ybGQ="}}
id: 2

data: [DONE]

Report:
[
  {
    "path": "$[\"0\"][\"b64_json\"]",
    "decodedBytes": 5,
    "base64": "SGVsbG8="
  },
  {
    "path": "$[\"1\"][\"audio\"][\"data\"]",
    "decodedBytes": 5,
    "base64": "V29ybGQ="
  }
]

Which fields count as Base64

The records are collected into one array and scanned with the same rules as the AI API Base64 Extractor. A string is tested when its key is data, base64, b64, b64_json, audioContent, image_url, image, file, content, payload or bytes, in any letter case, or when the string starts with a data URL header. Strings that fail strict Base64 decoding are skipped.

Two effects follow. Streams that put audio or image bytes under another key, for example delta, report nothing. Text streams that use content for tokens can produce false hits, because a 4-letter token such as word is also valid Base64. Judge entries by decodedBytes: media chunks are hundreds or thousands of bytes, stray tokens are 3.

Common errors with stream captures

The parser is strict on purpose and reports a problem instead of guessing.

  • Choosing NDJSON for an SSE capture fails on the first line, because a line that starts with data: or event: is not JSON. Switch the Input format.
  • Choosing Server-sent events for NDJSON finds no data: lines and ends with No Base64 payloads were found.
  • One broken record stops the whole run with the browser's JSON syntax error. Captures cut off in the middle of an event are the usual reason, so delete the last partial record.
  • More than 100 payloads stops the run with a request for a smaller payload. Paste the stream in sections.

Frequently asked questions

Does the tool join the chunks into one file?

No. It lists each chunk separately. To rebuild the media, copy the base64 values in order into the Base64 Chunk Joiner and choose Independently encoded blocks, since streaming services normally encode the bytes of each event on their own.

How do I capture an SSE stream to paste here?

Run the request with curl using the -N option to disable buffering and redirect the output to a file, or copy the response from the network panel of your browser's developer tools. Keep the blank lines between events, because they are the separators.

What happens to the [DONE] line?

It is removed before parsing. Many chat-style streams end with data: [DONE], which is not JSON. The tool drops any record whose trimmed text is exactly [DONE], in both input formats.

Is the captured stream uploaded?

No. The text is split, parsed and scanned by JavaScript in your browser. Captures that contain prompts or generated audio are not transmitted.

Related tools