SSE Stream Parser

Parses pasted SSE text into event, id, retry and data fields and returns a JSON event list. It does not validate stream termination or connect to a server.

Sse Formatter · Client runtimeSandboxed
Formatted results will render here in real time.

About this sse stream parser

Parses pasted SSE text into event, id, retry and data fields and returns a JSON event list. It does not validate stream termination or connect to a server Validates and converts interface schemas client-side without transmitting private endpoint specifications.

API contract & interface schema logic

Splits pasted SSE text into event records, joins data lines and returns JSON; it also flushes the last record at end-of-input without requiring a blank line.

Worked schema conversion scenario

Scenario: Parse submitted SSE-like lines into a local JSON summary without opening a stream.

Sample input:

event: message data: {"token": "Hello", "finish": false} event: done data: [DONE]

Processing: Collect event, id, retry, and data fields, join repeated data lines, and flush at a blank line or end of input. Data remains text; no JSON payload decoding or network validation occurs.

Illustrative output:

[ { "event": "message", "data": "{\"token\": \"Hello\", \"finish\": false}" }, { "event": "done", "data": "[DONE]" } ]

Schema version & syntax constraints

This is an offline subset parser, not a live stream tester. It ignores comments and unknown fields and does not require or verify a trailing blank line.

API specifications and schema models in SSE Stream Parser reflect OpenAPI and JSON Schema standards. Verify generated schemas against your runtime validator.

Client-side schema processing boundary

Schema analysis and protocol mapping in SSE Stream Parser execute locally in the browser tab without uploading endpoint definitions.

OpenAPI Specification & JSON Schema standards

OpenAPI Specification standards and JSON Schema draft definitions:

SSE Stream Parser verification · Audit standards

How to use it

  1. Paste SSE-formatted text.
  2. Split records at blank lines, join data lines, and collect event, id and numeric retry fields; flush a final record at EOF.
  3. Read the JSON event array.

Frequently asked questions

How does SSE Formatter parse an event stream?+

It reads lines, ignores comment lines beginning with colon, collects event, id, retry and one or more data fields, joins repeated data values with a newline, and flushes an event at a blank line or end of input.

Can you show an input and its result?+

An event ping with id 7, two data lines and retry 1500 produced one JSON event with event ping, id 7, data first followed by second on a newline, and numeric retry 1500.

Which Server-Sent Events behavior is outside the page?+

It does not open an EventSource connection, parse HTTP headers, retain last-event IDs, reconnect, dispatch DOM events, check MIME type, validate UTF-8 transport, or model browser retry behavior.

Does formatted SSE prove stream delivery?+

No. It only parses submitted text locally. A live stream still depends on endpoint availability, proxy buffering, CORS, credentials, network disruption and browser EventSource handling.