file in abyss
Back to formats

Image

SVG Scalable Vector Graphics

Scalable Vector Graphics is a image format commonly identified by .svg. Use the listed signatures, MIME types, and structure notes to validate files beyond the extension.

Extensions .svg
MIME image/svg+xml

Magic numbers

Analyze your file
offset 0 Scalable Vector Graphics leading signature
3C 73 76 67
<svg
offset 0 Scalable Vector Graphics leading signature
3C 3F 78 6D 6C
<?xml

Structure

  1. Optional XML declaration
  2. svg root element
  3. Shapes
  4. Styles
  5. Metadata

Caveats

  • Do not trust the extension alone. Check the MIME type, the first bytes such as 3C 73 76 67, and format-specific structure when possible.
  • Container formats and damaged files can share the same opening bytes, so deeper validation may be required for production upload, preview, or conversion flows.

Detection example

SIGNATURE = bytes.fromhex("3c737667")
OFFSET = 0

def is_svg(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

Practical usage

Use cases

Scalable Vector Graphics is commonly used for image previews, thumbnails, metadata checks, and upload validation. Test multiple sizes because resolution, alpha support, compression, and file size often affect implementation behavior.

Common detection mistakes

  • The .svg extension alone does not prove the file contents. Upload and conversion flows should combine extension, MIME type, leading bytes, and format-specific structure checks.
  • Scalable Vector Graphics can start with signatures such as 3C 73 76 67 or 3C 3F 78 6D 6C, but related containers and damaged files may require additional validation.

Security notes

Media files can still stress decoders through corrupt metadata, extreme dimensions, long durations, or unusual chunks. Read size, dimensions, and duration before processing.

Using samples

11 samples help test tiny images, high-resolution images, alpha channels, and hard-to-compress assets.

Sample files

11 / 11 files
Sample Traits Size Source / license / SHA-256
Soft Sky SVG preview

Soft Sky SVG

Soft Sky SVG is a Scalable Vector Graphics sample generated for file format testing, 640 x 360. It can be used to test downloads, parsers, previews, and file type detection.

soft-sky.svg
Resolution 640 x 360 230 Kpx
PreviewSmall file
526 B
Generated CC0 1.0
SHA-256 04300b35b7d89fa0aa68e95ab63dac29a53438cb8c111d088d4f0b0d5461c40f
Download
Blue Sky SVG preview

Blue Sky SVG

Blue Sky SVG is a Scalable Vector Graphics sample based on Wikimedia Commons, 64 x 64. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.svg
Resolution 64 x 64 4 Kpx
TinySmall file
658 B
SHA-256 d354cdd8ca8a36f09a6b412b5b6f2603c69a09a95796e9065069a9a8e3e19c7d
Download
Flower Garden SVG preview

Flower Garden SVG

Flower Garden SVG is a Scalable Vector Graphics sample based on Wikimedia Commons, 128 x 72. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.svg
Resolution 128 x 72 9 Kpx
PreviewSmall file
669 B
SHA-256 c92ee56b9ed9ceb6c2f4ac18f838fe80d70b215d2ef062f4e0b7821c7b012ba8
Download
Navy Blue Sky SVG preview

Navy Blue Sky SVG

Navy Blue Sky SVG is a Scalable Vector Graphics sample based on Wikimedia Commons, 256 x 144. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.svg
Resolution 256 x 144 37 Kpx
PreviewSmall file
682 B
SHA-256 6791490033e987b6e80fcc787fbb2cf76f5b871c9ec85da40401d9dbc1d72c3d
Download
Nature of the Sky SVG preview

Nature of the Sky SVG

Nature of the Sky SVG is a Scalable Vector Graphics sample based on Wikimedia Commons, 360 x 640. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.svg
Resolution 360 x 640 230 Kpx
PreviewSmall file
688 B
SHA-256 c706c311f90100386a398190a5c87ff625da1d18fdfcebd12d1755f171b5c07d
Download
Sky Landscape SVG preview

Sky Landscape SVG

Sky Landscape SVG is a Scalable Vector Graphics sample based on Wikimedia Commons, 640 x 360. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.svg
Resolution 640 x 360 230 Kpx
PreviewSmall file
685 B
SHA-256 527425180e0137305b115b812658007ad012718772d3ceed6c4a6e1365801813
Download
Starry Sky SVG preview

Starry Sky SVG

Starry Sky SVG is a Scalable Vector Graphics sample based on Wikimedia Commons, 800 x 600. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.svg
Resolution 800 x 600 480 Kpx
PreviewSmall file
683 B
SHA-256 b9d8b6026d5115e46ef1131d7a8f5d6792208ef4d61302892c5ab7cb8f2ffb36
Download
Blue Night Sky SVG preview

Blue Night Sky SVG

Blue Night Sky SVG is a Scalable Vector Graphics sample based on Wikimedia Commons, 1024 x 768. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.svg
Resolution 1024 x 768 786 Kpx
PreviewSmall file
692 B
SHA-256 747fea89e431864c83b5a614dd885ca38574ddbb03f9f9b84334dc8113c6a984
Download
Hibiscus Flower SVG preview

Hibiscus Flower SVG

Hibiscus Flower SVG is a Scalable Vector Graphics sample based on Wikimedia Commons, 1280 x 720. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.svg
Resolution 1280 x 720 922 Kpx
PreviewSmall file
694 B
SHA-256 c18770f0e9d692d815e99a89e6ab2f9beaaa3913847d1d5d60becbc677c56335
Download
Arctic Sky SVG preview

Arctic Sky SVG

Arctic Sky SVG is a Scalable Vector Graphics sample based on Wikimedia Commons, 1600 x 900. It can be used to test downloads, parsers, previews, and file type detection.

09-arctic-sky.svg
Resolution 1600 x 900 1.4 MP
PreviewSmall file
690 B
SHA-256 ccaca49cab5b5a22d4c4d581a2a38a88ca3ab561e44dde9cddaf4bf435375485
Download
NASA Blue Marble Metadata SVG preview

NASA Blue Marble Metadata SVG

NASA Blue Marble Metadata SVG is a Scalable Vector Graphics sample based on NASA Image and Video Library, 640 x 360. It can be used to test downloads, parsers, previews, and file type detection.

nasa-blue-marble-2012-east.svg
Resolution 640 x 360 230 Kpx
PreviewSmall file
685 B
SHA-256 ee1de3cc3ccb1639c12b616324893b8a33a2f28aa1239b624fd45493f339c0b1
Download

Frequently asked questions

What is the magic number (file signature) of Scalable Vector Graphics?

Scalable Vector Graphics files begin with the byte signature 3C 73 76 67 ("<svg") or 3C 3F 78 6D 6C ("<?xml"). Detect the format by reading these leading bytes rather than trusting the file extension alone.

What is the MIME type of Scalable Vector Graphics?

The MIME type for Scalable Vector Graphics is image/svg+xml.

What file extension does Scalable Vector Graphics use?

Scalable Vector Graphics files use the .svg extension. The extension is a convention only and does not guarantee the file contents, so combine it with signature and structure checks.

Related formats