# SVG

> SVG is an XML-based vector image format. How to embed it, what each method allows, and the alt text and Google Images points to get right.

Canonical: https://scaplet.com/glossary/svg

Glossary Glossary · Images

SVG is an XML-based vector image format. How to embed it, what each method allows, and the alt text and Google Images points to get right.

3 min

read

4

sources

Oct 29, 2026

updated

Scaplet Editorial Team

author

In one line

SVG (Scalable Vector Graphics) is an XML-based markup language for two-dimensional vector graphics, so it scales to any size without losing quality. Google Images supports SVG for images referenced in an img element's src attribute. Inline SVG takes a title element instead of alt text.

30-second check

## Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fsvg%20(%22SVG%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fsvg%20(%22SVG%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fsvg%20(%22SVG%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fsvg%20(%22SVG%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

## At a glance

4 facts from the sources below

XML-based vector format

Type

Listed as a supported format in img src

Google Images

`alt` attribute

Img alt

`<title>`, not `alt`

Inline alt

_01_At a glance

## Vector versus raster

MDN describes SVG as a text-based, open web standard from the W3C: shapes, paths and text described in XML. Because it is vector, it renders at any size without quality loss, unlike bitmap formats such as JPEG or PNG. Because it is text, it can be edited, scripted, compressed and indexed.

Format

### SVG

Kind

Vector, XML text

Scales cleanly

Yes

Fits best

Logos, icons, diagrams, simple illustrations

Format

### PNG

Kind

Raster

Scales cleanly

No

Fits best

Screenshots, graphics needing lossless pixels

Format

### JPEG

Kind

Raster

Scales cleanly

No

Fits best

Photos

Format

### [WebP](/glossary/webp) and [AVIF](/glossary/avif)

Kind

Raster

Scales cleanly

No

Fits best

Photos and graphics at smaller file sizes

_02_At a glance

## Embed methods and what each allows

Method

### `<img src>`

Alt text

`alt` attribute

Scripts and external files

Scripts disabled, external resources do not load

Google Images

Supported format

Method

### Inline `<svg>`

Alt text

`<title>`, `<desc>`, ARIA. `alt` is not supported

Scripts and external files

Part of the page DOM

Google Images

Google advises `<title>`

Method

### `<object>`, `<iframe>`, `<embed>`

Alt text

Not covered by the pages cited here

Scripts and external files

Image-context limits do not apply

Google Images

Not addressed in Google's image guidance

Three ways to place the same SVG

```
<!-- As an image: gets alt text --> <img src="/logo.svg" alt="Acme logo" width="120" height="32"> <!-- Inline: part of the DOM, uses title and ARIA --> <svg viewBox="0 0 100 100" role="img" aria-labelledby="t"> <title id="t">Growth chart</title> <circle cx="50" cy="50" r="40" fill="teal" /> </svg> <!-- Separate document, keeps scripts and external resources --> <object data="/chart.svg" type="image/svg+xml"></object>
```

MDN lists the image-context limits: JavaScript is disabled, external resources such as images and stylesheets do not load unless inlined as `data:` URLs, and some link and widget styling is off. If an SVG needs scripts or external files, MDN says to embed it with `object`, `iframe` or `embed`.

_03_Good to know

## SVG in Google Images

Google's image guidance lists the formats it supports for images in an `img` element's `src` attribute: BMP, GIF, JPEG, PNG, WebP, SVG and AVIF. It finds images in `img` elements and does not index CSS background images. It also says inline `<svg>` elements take a `<title>` rather than an `alt` attribute.

Everything else in Google's image advice still applies: descriptive filenames, useful alt text without [keyword stuffing](/glossary/keyword-stuffing), and one consistent URL per image across pages. See [image SEO](/glossary/image-seo) and [alt text](/glossary/alt-text).

A CSS background SVG is invisible to image search

If a logo or diagram is set with `background-image: url(chart.svg)`, Google does not index it as an image. Use an `img` element when you want it discoverable.

_04_How it works

## Check it in 2 minutes

Find SVGs and how they are served

```
# Every svg referenced in img tags curl -s https://example.com/ | grep -o '<img[^>]*\.svg[^>]*>' # Content type and compression of one file curl -sI -H 'Accept-Encoding: gzip, br' https://example.com/logo.svg | grep -iE '^(content-type|content-encoding|cache-control)'
```

Use SVG for
- Logos and icons that must look sharp at any size
- Simple diagrams and charts
- Graphics you want to style or animate with CSS

Use a raster format for
- Photographs
- Complex images where the vector file would be huge
- Screenshots

1. 01

### Check the markup

Each informative SVG used as an image needs a meaningful `alt`. Inline ones need a `<title>`.
2. 02

### Check the content type

You want `image/svg+xml`. MDN notes SVG files are text and can be compressed. See [gzip compression](/glossary/gzip-compression).
3. 03

### Check it is not a background

Search your CSS for `url(*.svg)` used for content images that should be searchable.
4. 04

### Test in Search Console

Inspect the page with the [URL Inspection tool](/glossary/url-inspection-tool) and confirm the [rendered HTML](/glossary/rendered-html) contains the `img` or inline `svg`.

Questions

## Asked a lot.

2 questions people ask next, answered from the sources on this page.

_01_ Does Google index SVG images?

Google's image guidance lists SVG among supported formats for images referenced in an img element's src attribute. It does not index CSS background images, so the [markup](/glossary/structured-data) matters.

_02_ How do I add alt text to an inline SVG?

Inline SVG does not support the alt attribute. Use a [title element](/glossary/title-tag) as the first child, optionally a desc element, and ARIA attributes such as role="img" and aria-labelledby.

Sources · 4

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- mozilla.org
- google.com

1. 01 [SVG: Scalable Vector Graphics (MDN)](https://developer.mozilla.org/en-US/docs/Web/SVG) developer.mozilla.org · checked 2026-11-01
2. 02 [SVG as an image (MDN)](https://developer.mozilla.org/en-US/docs/Web/SVG/Guides/SVG_as_an_image) developer.mozilla.org · checked 2026-11-01
3. 03 [SVG in HTML (MDN)](https://developer.mozilla.org/en-US/docs/Web/SVG/Guides/SVG_in_HTML) developer.mozilla.org · checked 2026-11-01
4. 04 [Google Images best practices](https://developers.google.com/search/docs/appearance/google-images) developers.google.com · checked 2026-11-01

## Keep learning

[All glossary](/glossary)

[Learn Responsive images Performance](/glossary/responsive-images) [Related Image compression Performance](/glossary/image-compression) [Read next Alt text On-page SEO](/glossary/alt-text) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in glossary
[Structured outputs](/glossary/structured-outputs) [Subdomain vs subdirectory](/glossary/subdomain-vs-subdirectory) [System prompt](/glossary/system-prompt)

More in Performance
[Page speed](/glossary/page-speed) [PageSpeed Insights](/glossary/pagespeed-insights) [preconnect](/glossary/preconnect) [preload](/glossary/preload) [Progressive web app](/glossary/progressive-web-app) [Real user monitoring (RUM)](/glossary/real-user-monitoring) [Render-blocking](/glossary/render-blocking) [Responsive design](/glossary/responsive-design) [Responsive images](/glossary/responsive-images) [Service worker](/glossary/service-worker) [Speculation rules](/glossary/speculation-rules) [Speed Index](/glossary/speed-index) [SVG](/glossary/svg) [Synthetic monitoring](/glossary/synthetic-monitoring) [Time to First Byte (TTFB)](/glossary/time-to-first-byte) [Time to Interactive (TTI)](/glossary/time-to-interactive) [Total Blocking Time (TBT)](/glossary/total-blocking-time) [TTL (time to live)](/glossary/ttl) [Viewport meta tag](/glossary/viewport-meta-tag) [WebP](/glossary/webp) [AVIF](/glossary/avif) [bfcache (back/forward cache)](/glossary/bfcache) [Brotli compression](/glossary/brotli-compression) [Cache-Control](/glossary/cache-control)

Terms on this page
[WebP](/glossary/webp) [AVIF](/glossary/avif) [Image SEO](/glossary/image-seo) [Alt text](/glossary/alt-text) [Keyword stuffing](/glossary/keyword-stuffing) [Gzip compression](/glossary/gzip-compression) [URL Inspection tool](/glossary/url-inspection-tool) [Rendered HTML](/glossary/rendered-html)

Free · 2 minutes

## Know the term. _Now check your site._

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **+212%** organic clicks in 90 days Ledgerly
