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
US tax withholding - Airbnb Help Centre
What are Azure Security Services for Businesses
Nullreferenceexception 7 Days To Die
Cottonwood Vet Ottawa Ks
The UPS Store | Ship & Print Here > 400 West Broadway
Kokichi's Day At The Zoo
Jefferey Dahmer Autopsy Photos
Koordinaten w43/b14 mit Umrechner in alle Koordinatensysteme
Big Spring Skip The Games
Kagtwt
Bbc 5Live Schedule
Simple Steamed Purple Sweet Potatoes
South Bend Tribune Online
Jasmine Put A Ring On It Age
10 Best Places to Go and Things to Know for a Trip to the Hickory M...
Swgoh Turn Meter Reduction Teams
NBA 2k23 MyTEAM guide: Every Trophy Case Agenda for all 30 teams
Sizewise Stat Login
The best firm mattress 2024, approved by sleep experts
Puretalkusa.com/Amac
Crossword Help - Find Missing Letters & Solve Clues
2021 MTV Video Music Awards: See the Complete List of Nominees - E! Online
Cars & Trucks - By Owner near Kissimmee, FL - craigslist
Craigslist Northern Minnesota
Hwy 57 Nursery Michie Tn
Lindy Kendra Scott Obituary
Himekishi Ga Classmate Raw
Spirited Showtimes Near Marcus Twin Creek Cinema
Storelink Afs
Rund um die SIM-Karte | ALDI TALK
Http://N14.Ultipro.com
Phone number detective
Scioto Post News
Robot or human?
B.k. Miller Chitterlings
Craigslist In Myrtle Beach
The Bold And The Beautiful Recaps Soap Central
Buhsd Studentvue
Busch Gardens Wait Times
Ticket To Paradise Showtimes Near Regal Citrus Park
The Realreal Temporary Closure
St Vrain Schoology
What is 'Breaking Bad' star Aaron Paul's Net Worth?
Canada Life Insurance Comparison Ivari Vs Sun Life
Craigslist Free Cats Near Me
O.c Craigslist
7 Sites to Identify the Owner of a Phone Number
Secondary Math 2 Module 3 Answers
Obituaries in Westchester, NY | The Journal News
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.