Server-Sent Events (SSE) Formatter — Build and Debug Real-Time Streams
Build Server-Sent Events messages with id, event, data, retry, and comment fields for testing SSE endpoints. Fill in each field individually and instantly see the correctly formatted SSE message string with double-newline terminator. Supports multi-line data fields, keep-alive comment lines, and an escaped wire-format view. Five presets cover the most common SSE patterns. Free and runs entirely in your browser.
How to Use Server-Sent Events (SSE) Formatter — Build and Debug Real-Time Streams
How to Use the SSE Event Formatter:
Load a Preset (Optional): Click any preset button at the top to pre-fill all fields with a real-world SSE pattern. Simple loads a plain data-only event. Named Event shows a typed JSON event with an id. Multi-line demonstrates streaming chunks as separate data fields. With Retry sets a custom reconnection delay. Heartbeat shows a keep-alive comment-only message. Each preset can be edited after loading.
Enter a Comment (Optional): The comment field renders as a line starting with
:(colon-space). Per the SSE specification, comment lines are completely ignored by the browser's EventSource client and are used to keep the connection alive during idle periods. Type any text — "ping", "keep-alive", or server metadata — and it will appear as: your textin the formatted output.Enter an Event ID (Optional): The id field sets the event identifier. The browser stores this value and sends it as a Last-Event-ID header on reconnection, allowing the server to resume the stream from the correct position after a disconnect. Use sequential integers, UUIDs, or timestamps as appropriate for your stream design.
Enter an Event Type (Optional): The event field sets the event type name. If omitted, the browser dispatches the event as a generic "message" event and your addEventListener("message", handler) will receive it. If set, use a named event listener — addEventListener("update", handler) for event: update. Event type names should not contain whitespace.
Enter the Data Payload: The data textarea is the main content of the event. For JSON payloads, paste the serialised JSON on a single line. For multi-line streaming responses, press Enter to add a new line — each line in the textarea becomes a separate data: field in the formatted output. The browser concatenates multiple data fields with a newline when constructing the event data property.
Enter a Retry Value (Optional): The retry field tells the browser how many milliseconds to wait before attempting to reconnect after the stream drops. Enter a non-negative integer only — decimals and negative values are not valid per the SSE specification. A common value is 3000 (3 seconds). If omitted, the browser uses its default reconnection interval (typically a few seconds).
Read the Stats Row: Three metrics update instantly above the output: Fields (number of active SSE fields in the message), Data lines (how many data: lines were generated from the data textarea), and Bytes (the total byte size of the formatted message including the terminating blank line).
Switch Between Formatted and Escaped Views: The Formatted view shows the message exactly as it would appear on the wire, with real line breaks and a trailing blank line. The Escaped view shows the literal \n characters — useful for constructing the string in code (e.g., when writing a Python/Node.js SSE endpoint that builds the response string manually).
Copy the Message: Click Copy to copy the formatted SSE message string (with actual newlines) to your clipboard. Use it in curl to test an SSE endpoint, in Postman's response body, or directly in server-side code. The copied text always includes the double-newline terminator required by the SSE specification.
Test Your Endpoint: Paste the formatted message into a tool like curl or Postman to simulate an SSE response. A valid SSE response requires Content-Type: text/event-stream and Transfer-Encoding: chunked or HTTP/2 streaming. Each event in the stream must end with a blank line (\n\n).
Common Use Cases:
- SSE endpoint development: Format test events to verify your EventSource client parses id, event, data, and retry fields correctly before integrating with a live stream.
- Streaming LLM responses: Build multi-line data messages that simulate chunked text from an AI model to test your frontend streaming UI.
- Real-time notification systems: Construct named events (event: notification) with JSON payloads to test browser-side event listeners.
- Keep-alive debugging: Generate heartbeat comment messages (: ping) to verify that your SSE middleware does not drop idle connections.
- Reconnection testing: Set a retry field to test that your client respects the server-specified reconnection delay rather than using the browser default.
- SSE proxy testing: Format edge-case messages (empty data, multi-line data, missing fields) to verify your SSE proxy or middleware handles all valid SSE shapes correctly.
- Documentation and spec verification: Use the escaped view to confirm the exact byte sequence of a message when writing SSE protocol documentation.
Tips and Best Practices:
- Every valid SSE message must end with a blank line (\n\n). The formatter adds this automatically — do not add it manually in the data field.
- JSON payloads must be on a single line when used as SSE data. Newlines inside JSON would create multiple data: fields, and the browser would concatenate them with \n, producing broken JSON.
- Use the Multi-line preset to see how streaming token-by-token responses work — each token on a new textarea line becomes a separate data: field.
- The id field is optional but strongly recommended for any stream that clients may reconnect to. Without it, the browser cannot resume the stream after a network drop.
- Comments (: lines) are useful for keep-alive pings but generate zero data on the client side. Do not rely on them to carry information.
- The retry value is a hint to the browser, not a guarantee — some browsers cap the minimum reconnection delay regardless of the retry field.
- Use named events (event: type) to fan out different event types over a single SSE connection, with separate addEventListener calls on the client.
- Switch to the Escaped view when writing server code to see the exact string your endpoint must produce: fields joined by \n and terminated by \n\n.
Frequently Asked Questions
Most Viewed Tools
TOTP Code Generator — 2FA Testing Tool
Generate time-based one-time passwords from a TOTP secret key. Enter your base32 secret, choose a period and digit length, and get the current and next codes with a live countdown timer. Useful for testing and debugging 2FA integrations.
Use Tool →JSON to Zod — Schema Generator
Generate Zod validation schema code from a JSON sample object. Infers z.string(), z.number(), z.boolean(), z.array(), z.object(), and z.null() types automatically. Handles nested objects, arrays of objects with optional field detection, and outputs copy-ready TypeScript with import and z.infer type alias.
Use Tool →JSONL Formatter — Line-by-Line Validator
Format, validate, and inspect JSON Lines (JSONL) and NDJSON files. Validates each line individually, reports parse errors by line number, outputs compact JSONL or a pretty-print preview, and lets you download the cleaned file.
Use Tool →Screen Size Converter — Diagonal Dimension Tool
Calculate screen width and height from diagonal size and aspect ratio. Convert between inches and centimeters for displays, TVs, and monitors with instant dimension calculations.
Use Tool →Password Entropy Calculator — Crack Time Estimator
Calculate the information-theoretic bit entropy of any password or API key. Detects character set pools automatically, shows the total number of possible combinations, and estimates crack time across five attack scenarios from rate-limited web logins to GPU cracking clusters.
Use Tool →TLS Cipher Suite Checker — Strength Analyzer
Check TLS protocol version compatibility and cipher suite strength ratings against current best practices. Supports IANA and OpenSSL cipher names — rates each suite as Strong, Weak, or Deprecated and explains why.
Use Tool →Secret Scanner — API Key & Credential Detector
Scan pasted text, code, or config files for accidentally exposed API keys, tokens, passwords, and private keys. Detects 50+ secret types across AWS, GitHub, Stripe, OpenAI, and more — all client-side, nothing leaves your browser.
Use Tool →TOML Config Validator — Syntax Error Finder
Validate TOML configuration file syntax and report errors with line numbers. Paste any TOML content — Cargo.toml, pyproject.toml, config.toml — and instantly see a green checkmark with key counts and structure stats, or a precise error message pointing to the exact line. Includes a collapsible JSON structure preview to confirm what was parsed.
Use Tool →Related API & Backend Tools
REST Endpoint Documenter — Markdown Doc Generator
Document a REST endpoint quickly by entering the URL, method, headers, and sample request/response. Generates formatted Markdown documentation and an example cURL command instantly.
Use Tool →GraphQL Variables Formatter — Query Validator
Format and validate GraphQL query variables JSON for use in queries and API clients. Paste your variables JSON alongside a GraphQL query to instantly format the JSON, validate that each variable matches its declared type, catch missing required variables, and highlight undeclared extras.
Use Tool →OAuth Token Validator — JWT & OIDC Decoder
Validate and inspect OAuth tokens in your browser. Decode JWT access tokens and ID tokens to view claims, scopes, and expiry. Analyse opaque tokens for entropy and format. Free and private.
Use Tool →Webhook Retry Config Calculator — Simulate Exponential Backoff & Jitter
Configure exponential backoff parameters and preview the full retry schedule for webhook delivery. Enter max attempts, initial delay, multiplier, jitter, and a max delay cap to instantly see each retry timestamp, cumulative elapsed time, jitter range, and which delays hit the cap. Supports presets for standard, aggressive, conservative, Stripe-style, and fixed-interval retry policies. Free and runs entirely in your browser.
Use Tool →API Latency Budget Calculator — Plan Distributed System Performance
Set a P99 SLO latency target and distribute the budget across your upstream service dependencies. See remaining headroom, utilization percentage, a stacked allocation bar, and a per-service breakdown with optional P99 actual measurements.
Use Tool →API Mock Data Generator — Realistic JSON Builder
Generate structured, realistic mock data for API endpoint testing. Define fields with names and types — UUID, name, email, integer, enum, date, and more — set how many rows you need, and export as a JSON array, NDJSON, or CSV. All generation runs entirely in your browser with no data sent to any server.
Use Tool →HTTP Retry Policy Builder — Configure Resilient API Client Logic
Configure max retries, initial delay, backoff multiplier, jitter, max delay cap, and retryable HTTP status codes to instantly generate ready-to-use retry policy code for Axios (with axios-retry), native Fetch API (Node 18+ and node-fetch), and Go net/http. Supports presets for Standard, Aggressive, Conservative, and Rate-Limit Aware policies. All code is generated in your browser — free, instant, no signup.
Use Tool →OpenAPI Mock Generator — Turn API Specs into Live Mock Servers
Paste an OpenAPI 3.x or Swagger 2.0 spec, select any endpoint, and instantly get a realistic mock request body and response matching the defined schemas. Also generates a ready-to-run cURL command.
Use Tool →Share Your Feedback
Help us improve this tool by sharing your experience