What Is a Snippet?
A snippet is a short excerpt from the matching page’s content, selected by Google’s indexing systems to best represent how the page relates to the search query. Google constructs snippets dynamically for each query — the same page can yield different snippets for different search terms. Snippets are typically 150–300 characters long, though the exact length varies.Snippets are generated by Google at index time and query time. You cannot set or override them through the API. You can, however, influence which part of a page is excerpted by using the
exactTerms parameter (see below).The Two Snippet Fields
Each resultitem contains two snippet fields that carry the same underlying text in different formats.
string
The plain-text version of the excerpt. All HTML tags are stripped, and special characters are decoded. Use this field when rendering results in non-HTML environments (terminal output, native mobile apps, plain-text emails, or when you want to apply your own formatting).Example value:
string
The HTML-annotated version of the excerpt. Query terms that match words in the snippet are wrapped in
<b> tags. Line breaks within the snippet are represented as <br> tags. Certain special characters and hyphens may be encoded as HTML entities (e.g., ‑ for a non-breaking hyphen).Use this field when rendering results inside an HTML page. Drop it into your template and the browser will render bold highlights automatically.Example value:Plain Text vs. HTML: Side-by-Side
- Plain text (snippet)
- HTML (htmlSnippet)
- Rendering in a native app or terminal
- Passing the text to an LLM or downstream NLP pipeline
- Building plain-text email digests
- Applying your own custom highlight logic
Snippet Length
Google controls snippet length based on its analysis of the page and query. You cannot specify an exact character count through the API. In practice:- Typical range: 150–300 characters of visible text
- Structured pages (those with schema.org markup or
<meta name="description">tags) may yield shorter, more precise snippets drawn from that metadata - Long-form articles often yield longer excerpts pulled from body text near the first occurrence of the query terms
- Ellipsis (
…) at the start or end of a snippet indicates the excerpt was taken from the middle of the page
Influencing Snippet Content with exactTerms
While you cannot directly control snippet selection, you can steer Google toward a specific part of a page by adding the exactTerms parameter to your request. Google will only return results where the page contains that exact phrase, and will preferentially excerpt the portion of the page that contains it.
Request example — find pages mentioning a specific release and excerpt that section:
exactTerms is set, Google is more likely to excerpt the sentence or paragraph containing that exact phrase, giving you a snippet focused on the topic you care about rather than a generic page introduction.
Rendering Snippets: Code Examples
Snippet Field Reference Summary
string
Plain-text excerpt from the result page. Query terms are not marked up. Safe to use in any rendering context without sanitization.
string
HTML-encoded excerpt. Query terms are wrapped in
<b> tags. Line breaks are <br> tags. Render only inside trusted HTML contexts, or sanitize before use.Common Questions
Can I make the snippet longer?
Can I make the snippet longer?
No. Snippet length is determined entirely by Google’s indexing and ranking systems. There is no API parameter to request a longer or shorter snippet. If you need more page content, consider fetching the page directly and extracting text server-side.
Why does the snippet sometimes not mention my query terms?
Why does the snippet sometimes not mention my query terms?
Google may select a snippet from a part of the page it considers more representative of the overall content, even if your query terms appear elsewhere. Adding
exactTerms with a specific phrase can help anchor the snippet to a relevant section.Why is htmlSnippet sometimes blank or missing?
Why is htmlSnippet sometimes blank or missing?
The
htmlSnippet field is always present when snippet is present — they derive from the same underlying data. If you see an empty string, the indexed page had insufficient text content for Google to generate an excerpt. This is uncommon but can occur for pages that are primarily images, PDFs, or heavily JavaScript-rendered without server-side text.Are snippets the same as meta descriptions?
Are snippets the same as meta descriptions?
Not necessarily. Google may use the page’s
<meta name="description"> content as the snippet, but it can also generate the snippet from any text on the page if it believes body text better matches the query. Structured data and meta descriptions increase the likelihood that your preferred text is used, but there is no guarantee.