How text to speech works in a browser, and why voices differ

Where browser voices come from, on-device versus online voices, why speech goes sentence by sentence, and how long a text takes to listen to at each speed.

Open the Read aloud Free, in your browser, nothing uploaded.

Text to speech lets you listen to an article, a chapter or your own draft instead of reading it. Phones and computers already carry voices for this, and a web page can use them without any app or account. This article explains how that works in the read aloud tool: where the voices come from, which ones keep your text on your device, how the text is cut into sentences, and how long listening will take. It is for students who learn better by ear, people with dyslexia or tired eyes, language learners and writers who want to hear a draft. If your PDF is a scan with no real text, run it through image to text first; to fix broken lines from a copied PDF, use text cleaner; and to see how hard a text is before you listen, try readability checker.

What it is

Browsers have a built-in speech feature, the Web Speech API. A page hands it a piece of text and a voice, and the browser speaks it. The voices are not part of the page: they come from your operating system and your browser.

That is why the list changes from device to device:

  • On-device voices are installed on your phone or computer. Speech is made locally, so your text stays on the device and works offline.
  • Online voices, offered by some browsers, often sound more natural, but the browser may send the text to its maker’s speech server. The tool lists these last and labels them.

The tool sorts the list so on-device voices for your language come first, then other on-device voices, then online ones.

Speech is sent one sentence at a time. That lets the page highlight the sentence being read, skip back and forward, and start from any sentence you tap. Browsers cannot always pause cleanly mid-word, so resuming starts that sentence again. Sentences end at ., !, ? or a line break. A very long sentence (over 220 characters) is cut at a comma, semicolon or colon, so no single piece runs on too long for the speech engine.

The time estimate assumes about 150 words a minute at normal speed, divided by the speed you set:

minutes ≈ words ÷ (150 × speed)

How to use it

  1. Paste text into the box, press Open PDF or TXT, or press Use a sample.
  2. Pick a Voice. On-device voices are at the top.
  3. Set Speed (0.5x to 2x) and Pitch with the sliders, and read the estimate of sentences and minutes.
  4. Press Read. Follow the highlighted sentence under Reading.
  5. Use Pause, Back, Next and Stop, or tap any sentence to jump there.

A worked example

Nisha wants to listen to an 1,800-word history chapter on her way to school.

  • At 1x: 1,800 ÷ 150 = 12 minutes.
  • At 0.8x, for difficult parts: 1,800 ÷ (150 × 0.8) = 15 minutes.
  • At 1.3x, for revision: 1,800 ÷ (150 × 1.3) ≈ 9.2 minutes, which the page rounds to 9 minutes.
  • At 2x: 6 minutes.

Before that, she tests the sentence splitting on a short note:

Photosynthesis needs light. Dr. Rao showed this in class! Did the leaf in the dark box make starch? and, on a new line, No.

The tool makes five pieces, not four: “Photosynthesis needs light.”, “Dr.”, “Rao showed this in class!”, “Did the leaf in the dark box make starch?” and “No.”. The full stop after “Dr” looks like the end of a sentence. The voice will still read it correctly, with a short pause, but the highlight jumps twice. Writing “Dr Rao” without the full stop avoids that.

Finally, a 286-character sentence listing five measurements from an experiment is longer than 220 characters, so it is read in two pieces, split at the comma before “and finally the colour of the solution”.

Checked with the tools

The times and splits above come from the tool’s own code (src/lib/docs/readaloud.ts) run in Node. readMinutes() gave 12, 15, 9.23 and 6 minutes for 1,800 words at 1x, 0.8x, 1.3x and 2x, and the page rounds to whole minutes. splitSentences() returned the five pieces and the two-part split. sortVoices() put sample voices in the order on-device English, on-device other language, then online.

Where it is used

  • Study and revision. Listening while following the highlight helps many learners, including those with dyslexia.
  • Proofreading. Hearing your own writing catches missing words and clumsy sentences that the eye skips.
  • Language learning. A slower speed with a native voice helps with pronunciation and listening.
  • Accessibility at work. Reports and long emails can be listened to while resting the eyes.

Common mistakes

  • Expecting the same voices everywhere. A voice on your laptop may not exist on your phone. Install more voices in your system’s speech or accessibility settings.
  • Opening a scanned PDF. A scan is a picture with no text to read. Use OCR first.
  • Reading copied PDF text with broken lines. Line breaks end sentences here, so a paragraph copied with a break on every line is read in fragments. Join the lines first.
  • Picking an online voice for private text. If the text is confidential, choose a voice marked as on this device.

Questions people ask

Why does the voice mispronounce names? Speech engines guess from spelling. Spelling a name the way it sounds, just for listening, often helps.

Can I save the speech as an audio file? Browsers do not give pages the audio from their speech voices, so the tool can only play it live.

Is listening at 2x useful? For revision of familiar material, many people find 1.5x to 2x fine. For new material, 1x or slower helps understanding.

Sources

  • Speech uses the browser's built-in Web Speech API (speechSynthesis). PDF text is extracted with pdf.js (Mozilla, Apache-2.0) in the page. Sentence splitting and the reading-time estimate (about 150 words a minute) are fibub's own.

If you are an author or publisher and want a credit or a passage changed or removed, tell us and we will act quickly.

Tools in this article

Read next