DevTools Logo

SSML Markup Builder

SSML Markup Builder

Build and validate speech markup locally in your browser

Segment editor

Validate pasted SSML

About

Edit speech segments and inspect live SSML XML. Validation checks balanced tags, allowed attributes, say-as types, and break time formats entirely in your browser.

Examples

Prosody with escaped text

Input
buildSsml([{ kind: "text", text: "Hello & welcome" }, { kind: "prosody", rate: "slow", pitch: "10%", text: "world" }])
Output
<speak>Hello &amp; welcome<prosody rate="slow" pitch="10%">world</prosody></speak>

Ampersands escape to &amp; while prosody attributes serialize verbatim.

Break plus say-as

Input
buildSsml([{ kind: "say-as", type: "cardinal", text: "42" }, { kind: "break", time: "500ms" }])
Output
<speak><say-as interpret-as="cardinal">42</say-as><break time="500ms"/></speak>

Cardinal formatting pairs with a self-closing 500ms pause inside the speak root.

About this tool

SSML Markup Builder composes speech XML with buildSsml(segments): text, speak, prosody (rate/pitch/volume), break (time), emphasis (level), say-as (date/characters/cardinal/ordinal via interpret-as), and sub (alias) render into a <speak> root with XML-escaped text and attributes, and identical input always yields identical output.

Validation is two-layered: buildSsml flags bad segment values (malformed break time, unknown say-as type, invalid prosody value, missing sub alias), while validateSsml(xml) parses raw SSML for unbalanced or unclosed tags, unsupported tags, disallowed attributes, non-self-closing break, and a missing speak root.

Break times accept milliseconds, seconds (including decimals like 1.5s), or nanoseconds (e.g. 500ms, 1s, 1000000ns), and special characters (& < > " ') escape to entities automatically. Everything runs in the browser with no audio data uploaded.

How to use this tool

  1. Add text and voice segments

    Combine plain text with prosody, emphasis, say-as, sub, and self-closing break segments in order.

  2. Set break and say-as values

    Write break times as 500ms, 1.5s, or nanoseconds, and restrict say-as to date, characters, cardinal, or ordinal.

  3. Build and validate

    Check buildSsml findings for value errors, then run validateSsml on the XML to catch unbalanced tags.

  4. Paste into your TTS voice

    Copy the <speak> XML into a synthesizer that accepts SSML input.

Use cases

Drafting voice prompts

Assemble prosody, pauses, and substitutions before sending to a TTS service.

Linting pasted SSML

Catch unbalanced tags, bad break times, and wrong say-as types in existing markup.

Formatting spoken numbers

Control date, cardinal, ordinal, and character readout for IDs and measurements.

Common mistakes

Mistake:Writing break as an open/close pair or with hours.

Fix:break must be self-closing (<break time="500ms"/>) with ms, s, or ns units — 2h fails validation.

Mistake:Inventing say-as types like money or telephone.

Fix:Only date, characters, cardinal, and ordinal are accepted; anything else is an error.

Frequently asked questions

What does this tool do?

It composes speech XML with buildSsml (text, prosody, break, emphasis, say-as, sub inside a <speak> root) and lints raw markup with validateSsml, which catches unbalanced tags, bad break times, and wrong say-as types.

Which break and say-as values are valid?

Break times accept ms, s (decimals allowed), or ns — e.g. 500ms, 1.5s, 1000000ns — and must be self-closing. say-as allows only date, characters, cardinal, or ordinal.

Is my SSML uploaded or stored?

No. Building, escaping, and validation run entirely in your browser.

How are special characters handled?

Text and attribute values XML-escape automatically (& to &amp;, < to &lt;, quotes to entities), so pasted prose cannot break the markup.

References & standards