SVG: Scalable Vector Graphics | MDN (2024)

Scalable Vector Graphics (SVG) is an XML-based markup language for describing two-dimensional based vector graphics.

As such, it's a text-based, open Web standard for describing images that can be rendered cleanly at any size and are designed specifically to work well with other web standards including CSS, DOM, JavaScript, and SMIL. SVG is, essentially, to graphics what HTML is to text.

SVG images and their related behaviors are defined in XML text files, which means they can be searched, indexed, scripted, and compressed. Additionally, this means they can be created and edited with any text editor or with drawing software.

Compared to classic bitmapped image formats such as JPEG or PNG, SVG-format vector images can be rendered at any size without loss of quality and can be easily localized by updating the text within them, without the need of a graphical editor to do so. With proper libraries, SVG files can even be localized on-the-fly.

SVG has been developed by the World Wide Web Consortium (W3C) since 1999.

See also, SVG Tutorial.

SVG: Scalable Vector Graphics | MDN (2024)

FAQs

What is SVG in vector graphics? ›

Scalable Vector Graphics (SVG) is a web-friendly vector file format. As opposed to pixel-based raster files like JPEGs, vector files store images via mathematical formulas based on points and lines on a grid.

Are SVG images scalable? ›

The SVG file format is an XML-based vector image format, and it's a perfect fit when designing for scale in a 2D format. The format provides limitless scalability so that your designs work across different mediums and in various sizes.

What does SVG stand for scalable graphics? ›

SVG stands for Scalable Vector Graphics, and they are indispensable for creating sharp, high-quality images on the web.

What is the difference between SVG Scalable Vector Graphics and canvas? ›

SVG and Canvas are HTML5 APIs for rendering vector and raster graphics, respectively. SVG is used to create vector-based graphics, whereas Canvas can render both vector and raster graphics. Canvas is better for quickly rendering graphics and animations with less control than SVG.

Is SVG better than PNG? ›

If you're working with simple graphics, icons, or logos, SVG may be the better choice due to its smaller file sizes and ability to be scaled without losing quality. However, if you're dealing with complex images or photographs, a PNG may be more appropriate due to its lossless compression and support for transparency.

What are SVG images best for? ›

As previously mentioned, one of the primary benefits of using SVG files is their ability to scale without losing quality. This makes them perfect for responsive web design, ensuring that your graphics will always look crisp and clear, regardless of the device or screen size.

Do SVG graphics lose quality if they are zoomed? ›

SVG graphics are scalable, and do not lose any quality if they are zoomed or resized. SVG is supported by all major browsers.

How do I make SVG scalable? ›

Step 1 − Adjust the parent container's width and height to the dimensions that you desire for the SVG. Step 2 − To the parent container, add the SVG. Step 3 − Set the SVG's width as well as height to 100% using CSS. Step 4 − To guarantee that the SVG's aspect ratio is preserved, use the preserveAspectRatio attribute.

What is the difference between SVG and vector graphics? ›

SVG (Scalable Vector Graphics) is a specific file format that uses XML to define vector graphics, making it a way to store and display vector images on the web or in various software. In essence, a vector is a conceptual idea, while SVG is a file format used to store and display vector graphics.

What is one benefit of using Scalable Vector Graphics SVG instead of images? ›

Scalable Vector Graphics (SVGs) work well for logos and graphics because you can scale them up or down for different purposes. They're also a popular choice in web design because search engines like Google can read their XML programming language. This helps with SEO and website rankings.

Why use Canvas instead of SVG? ›

Because Canvas is a lower level API than SVG, it offers more flexibility than SVG in exchange for greater complexity. The limit of what can be drawn on a Canvas is only limited by how much code a developer is willing to write. Any SVG image can be drawn with the Canvas API with enough effort.

What are scalable vector graphics files for? ›

The SVG file format is a popular tool for displaying two-dimensional graphics, charts, and illustrations on websites. Plus, as a vector file, it can be scaled up or down without losing any of its resolution.

Does scaling SVG image degrade image quality? ›

SVGs are vectors so they can rescale in size without losing any quality.

What is the SVG used for? ›

SVG files are great for web graphics like logos, illustrations, and charts. But their lack of pixels makes displaying high-quality digital photos difficult. JPEG files are generally better for detailed photographs. Only modern browsers can support SVG images.

Is SVG a good vector format? ›

SVGs (Scalable Vector Graphics) are an excellent choice for logos, icons, or any image that needs to appear sharp and high-quality, no matter the size.

Is SVG good or bad? ›

SVG images work very well when the image itself is relatively simple. They're often used as logos, buttons, icons, and nav bars, roles for which they are ideally suited. They're not ideal for images with a lot of detail, such as photographs. For those, it's usually best to stick with PNG or WebP files.

Top Articles
How to Use AI to Fight Financial Crime | FDM Group
A Beginner's Guide to Cardano (ADA): What You Need to Know
Www.1Tamilmv.cafe
Visitor Information | Medical Center
How to know if a financial advisor is good?
Boggle Brain Busters Bonus Answers
DENVER Überwachungskamera IOC-221, IP, WLAN, außen | 580950
Beds From Rent-A-Center
Umn Biology
Used Wood Cook Stoves For Sale Craigslist
Simon Montefiore artikelen kopen? Alle artikelen online
24 Hour Walmart Detroit Mi
Highland Park, Los Angeles, Neighborhood Guide
Simpsons Tapped Out Road To Riches
Straight Talk Phones With 7 Inch Screen
The Ultimate Style Guide To Casual Dress Code For Women
Parentvue Clarkston
Moving Sales Craigslist
Kentuky Fried Chicken Near Me
Sienna
Greensboro sit-in (1960) | History, Summary, Impact, & Facts
Amelia Chase Bank Murder
Synergy Grand Rapids Public Schools
Impact-Messung für bessere Ergebnisse « impact investing magazin
Kimoriiii Fansly
Gen 50 Kjv
3 Ways to Drive Employee Engagement with Recognition Programs | UKG
Xxn Abbreviation List 2023
Orange Park Dog Racing Results
Stephanie Bowe Downey Ca
Parent Management Training (PMT) Worksheet | HappierTHERAPY
Prévisions météo Paris à 15 jours - 1er site météo pour l'île-de-France
APUSH Unit 6 Practice DBQ Prompt Answers & Feedback | AP US History Class Notes | Fiveable
Ancestors The Humankind Odyssey Wikia
Ghid depunere declarație unică
Current Time In Maryland
Kattis-Solutions
Leland Nc Craigslist
Most popular Indian web series of 2022 (so far) as per IMDb: Rocket Boys, Panchayat, Mai in top 10
Kstate Qualtrics
Does Iherb Accept Ebt
Weapons Storehouse Nyt Crossword
Insideaveritt/Myportal
MSD Animal Health Hub: Nobivac® Rabies Q & A
Craigs List Hartford
Callie Gullickson Eye Patches
Avance Primary Care Morrisville
Unblocked Games - Gun Mayhem
Pickwick Electric Power Outage
Sherwin Source Intranet
Workday Latech Edu
Wera13X
Latest Posts
Article information

Author: Geoffrey Lueilwitz

Last Updated:

Views: 6407

Rating: 5 / 5 (80 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Geoffrey Lueilwitz

Birthday: 1997-03-23

Address: 74183 Thomas Course, Port Micheal, OK 55446-1529

Phone: +13408645881558

Job: Global Representative

Hobby: Sailing, Vehicle restoration, Rowing, Ghost hunting, Scrapbooking, Rugby, Board sports

Introduction: My name is Geoffrey Lueilwitz, I am a zealous, encouraging, sparkling, enchanting, graceful, faithful, nice person who loves writing and wants to share my knowledge and understanding with you.