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
Finanzielle Freiheit durch Selbstständigkeit | ETF Capital
How are Dividends Taxed and Reported to the IRS?
El Paso Pet Craigslist
Valley Fair Tickets Costco
Nfr Daysheet
San Diego Terminal 2 Parking Promo Code
PGA of America leaving Palm Beach Gardens for Frisco, Texas
Elle Daily Horoscope Virgo
Cranberry sauce, canned, sweetened, 1 slice (1/2" thick, approx 8 slices per can) - Health Encyclopedia
2016 Hyundai Sonata Price, Value, Depreciation & Reviews | Kelley Blue Book
6001 Canadian Ct Orlando Fl
Flower Mound Clavicle Trauma
This Modern World Daily Kos
Gon Deer Forum
Xomissmandi
The best TV and film to watch this week - A Very Royal Scandal to Tulsa King
Scout Shop Massapequa
Graphic Look Inside Jeffrey Dahmer
Heart Ring Worth Aj
Company History - Horizon NJ Health
HP PARTSURFER - spare part search portal
Lininii
Lawrence Ks Police Scanner
Tokioof
Donald Trump Assassination Gold Coin JD Vance USA Flag President FIGHT CIA FBI • $11.73
Homewatch Caregivers Salary
Grand Teton Pellet Stove Control Board
Navigating change - the workplace of tomorrow - key takeaways
Kelly Ripa Necklace 2022
Joey Gentile Lpsg
Skyward Marshfield
Engr 2300 Osu
How to Quickly Detect GI Stasis in Rabbits (and what to do about it) | The Bunny Lady
'Guys, you're just gonna have to deal with it': Ja Rule on women dominating modern rap, the lyrics he's 'ashamed' of, Ashanti, and his long-awaited comeback
814-747-6702
Rush Copley Swim Lessons
Tricare Dermatologists Near Me
Brake Pads - The Best Front and Rear Brake Pads for Cars, Trucks & SUVs | AutoZone
Brown launches digital hub to expand community, career exploration for students, alumni
Timothy Warren Cobb Obituary
Perc H965I With Rear Load Bracket
Hawkview Retreat Pa Cost
Iman Fashion Clearance
Ts In Baton Rouge
Zeeks Pizza Calories
A rough Sunday for some of the NFL's best teams in 2023 led to the three biggest upsets: Analysis
Spn 3464 Engine Throttle Actuator 1 Control Command
Sleep Outfitters Springhurst
Razor Edge Gotti Pitbull Price
Helpers Needed At Once Bug Fables
Nfsd Web Portal
Bones And All Showtimes Near Emagine Canton
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.