Glossary
Web Speech API
The Web Speech API is a set of browser interfaces that let a web page start speech recognition and receive the recognized words as text, through an object called SpeechRecognition. Where the recognition runs, on your device or on a server, depends on the browser.
Updated October 17, 20264 cited facts, each traced to its source
Also called SpeechRecognition, webkitSpeechRecognition.
The Web Speech API is a set of JavaScript interfaces built into web browsers. Its speech recognition part, the SpeechRecognition object, listens to the microphone and gives the page the words as text. The page then decides what to do with them, such as filling a search box or a note. Websites use it to offer voice input without a separate app to install.
A web page starts listening in a few lines of code
A page creates a recognizer, sets a handler for the results and calls start(). Browsers that expose only the prefixed name need a fallback, because the unprefixed name arrived later. MDN's compatibility data lists Chrome's unprefixed SpeechRecognition from version 139, and the webkit-prefixed version from version 33 1.
const Recognizer = window.SpeechRecognition || window.webkitSpeechRecognition;
const recognition = new Recognizer();
recognition.onresult = (event) => {
console.log(event.results [0][0].transcript);
};
recognition.start();
The MDN reference for SpeechRecognition documents the rest of the interface, including settings such as continuous and interimResults, which control whether the page receives partial results before a phrase is finished.
Where your audio goes depends on the browser
On some browsers, such as Chrome, speech recognition on a web page uses a server-based engine. MDN says the audio is sent to a web service for recognition, so the feature does not work offline 2. Chrome 139 added on-device recognition to the same API, so a site can make sure that neither the audio nor the transcribed speech goes to a third-party service 3.
That is why two dictation buttons on two websites can behave differently. Before you dictate sensitive text into a web tool, check which engine it uses.
The browser must ask you first
The specification requires that browsers start a speech input session only with explicit, informed user consent 4. In practice that consent is the browser's microphone prompt, and the setting that remembers your answer for each site. That setting is covered in site microphone permission.
Why it matters for dictation and typing
For dictation, the Web Speech API is the route by which a web page gets your words. A voice button on a web page uses the browser's speech engine, so its accuracy, language list and privacy depend on the browser and its settings as much as on the website. If a site's microphone button does nothing, the cause can be the permission rather than the page.
Our guide to speech to text in Chrome lists the built-in options, and free dictation in your browser shows the same idea in a finished tool.
Related terms
- Site microphone permission: the per-site setting that must allow the microphone.
- System-wide dictation: dictation that types into any text field, not only inside a web page.
- Voice typing: the general name for speech typed into a text box.
Guides that cover it
Evidence
Every number on this page, with where it comes from. Open a fact to see the exact words in its source.
- 1.
- 2.
- 3.
- 4.
Related terms
- Voice Typing in Google Docs, Word and Every Other AppThe topic this term belongs to
- Connected experiences (Microsoft 365)
- Cursorless
- Dictate (Microsoft 365)
- Dictation (ChromeOS)
- Site microphone permission
- Talon Voice
- Text insertion
- Transcribe (Microsoft 365)
- Vibe coding
- Voice coding
- Voice typing (Google Docs)
- Wayland
Pages that use this term
- Voice Typing in Google Docs, Word and Every Other AppTopic
- How to Turn On Voice Typing on Every DeviceGuide
- Speech to Text in Chrome: Built-in Options and ExtensionsGuide
- Web Speech API: Speech Recognition in the BrowserGuide
- Can Chrome do speech to text offline?Question
- How do you add speech recognition to a React or React Native app?Question
- How do you add speech recognition to a website with JavaScript?Question
- What is the best speech to text extension for Chrome?Question
- Which browsers support speech recognition?Question
- Why does speech recognition show a network or not-allowed error?Question
- Why is dictation not working in Apple Notes, Messages and Pages?Question
- Why is dictation not working in Chrome?Question
- Site microphone permissionGlossary
- Text insertionGlossary