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)Connected experiences are Microsoft 365 features backed by cloud services, and Dictate is one of the experiences that analyze your content. You can turn them off in Manage Settings, but that setting also turns off other services.
- CursorlessCursorless is a spoken language for structural code editing that lets developers code by voice. Every command is an action performed on a target in the code, and it runs on Talon with a VS Code extension.
- Dictate (Microsoft 365)Dictate is the speech-to-text feature in Microsoft 365 apps such as Word, Outlook and PowerPoint. It needs a Microsoft 365 subscription, a microphone and a reliable internet connection.
- Dictation (ChromeOS)Dictation on ChromeOS is a built-in accessibility feature that types recognized speech into an editable field. You turn it on with Search + D or the microphone icon in the status tray.
- Site microphone permissionSite microphone permission is the browser's setting for each website that decides whether that site may use your microphone, usually chosen when the browser prompts you. It works alongside the operating system's own microphone setting, so both must allow the microphone before a site can listen.
- Talon VoiceTalon Voice, usually called Talon, is hands-free input software for writing, coding, browsing and gaming. It runs alongside a speech-recognition engine, and it is used for voice coding, often together with the Cursorless editing language.
- Text insertionText insertion is the step where dictation software places recognized words into the text field that has the cursor. It is done either by simulating keystrokes or by pasting the text from the clipboard.
- Transcribe (Microsoft 365)Transcribe is a Word for Microsoft 365 feature that turns an uploaded audio file into text in the Transcribe pane, rather than typing your speech into the document. Its monthly limits depend on your license.
- Vibe codingVibe coding is building software by describing what you want to an AI model and accepting the code it writes, without reviewing that code. Andrej Karpathy introduced the term, and the developer Simon Willison argues for a narrower meaning than the broad one now in use.
- Voice codingVoice coding, also called programming by voice or coding by voice, is writing and editing source code by speaking instead of typing. It needs a speech-recognition engine and a separate platform that turns spoken words into code editing actions.
- Voice typing (Google Docs)Voice typing in Google Docs is a built-in speech-to-text tool that types as you speak. You start it from the Tools menu in a supported browser, and the browser controls the speech-to-text service.
- WaylandWayland is the display system that Linux desktops are moving to in place of the X Window System, called X11. Its compositor delivers input to each app, so a typing tool that worked on X11 may not type on a Wayland desktop.
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