Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsFor a normal web page, add an <img> element and point its src attribute to an image file. If you need one standalone HTML document that carries a small image inside it, use a data: URL containing the image’s base64-encoded bytes. These are different approaches: an ordinary image path refers to a separate resource; a data URL puts the image data in the HTML itself.
Add an image file to a web page
Use <img> for a single image. Its src value identifies the image, while alt provides a text alternative. For example:
<img src="images/photo.jpg" alt="A red canoe beside a wooded shore" width="1200" height="800">
This markup does not contain the image bytes. The browser loads the image as a separate resource from the location in src. The HTML Standard recommends the img element with its src attribute when embedding a single image resource.
Choose a relative or absolute path
A relative path points to a file in relation to the HTML document. If your project is arranged like this, for example:
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
project/
index.html
images/
photo.jpg
then src="images/photo.jpg" works when index.html is in the project root. If the HTML file is in a subfolder, adjust the path from that file’s location. An absolute URL, such as https://example.com/images/photo.jpg, points to an image hosted at that address instead.
The file must be present and reachable at the specified location when the page is opened or served. A path that works on your development computer can fail after deployment if the image was not included, the deployed folder structure differs, or the path uses the wrong capitalization.
Write useful alternative text
For an informative image, describe its relevant meaning in alt. The canoe example tells a reader who cannot see the image what it depicts. If the image is purely decorative and adds no information, use an empty value: alt="". Do not omit the attribute: an empty alternative is a deliberate signal that a decorative image does not need a spoken description.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
Set dimensions when you know them
Set the image’s intrinsic width and height when known. The browser can use their ratio to reserve space while the image loads, reducing unexpected layout movement. Use the image’s actual proportions; if the dimensions do not match its aspect ratio, the displayed image may be distorted unless your styling controls how it fits.
Recommended Free Tools
Put a small image inside the HTML file
If the HTML document must travel as one file with no neighboring image asset, put a data URL in src. The general form is data:[<media-type>][;base64],<data>. For a base64-encoded PNG, that means declaring image/png, including ;base64, then placing a comma between the metadata and the encoded data.
<img
src="data:image/png;base64,PASTE_THE_BASE64_ENCODED_IMAGE_DATA_HERE"
alt="A small decorative blue circle"
width="32"
height="32">
Replace PASTE_THE_BASE64_ENCODED_IMAGE_DATA_HERE with the actual base64 text for the image file. The example’s placeholder is not an image and will not render as one. Keep the comma after base64: it marks the start of the data. The MIME type must match the image, and the encoding marker must match how the bytes are represented.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
When an inline data URL makes sense
Inlining can be useful for a small icon or an HTML document that must be self-contained. It avoids a separate image path, but it also makes the HTML source larger and less convenient to read or edit. A base64 data URL is generally a poor fit for large images or images reused across multiple pages: each copy makes the document carry the encoded image again.
Browsers are not required to support a particular maximum data-URL length, and practical limits vary. There is no universal safe size threshold to rely on. If the image is more than small, or the page needs responsive image selection, prefer an ordinary file URL.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteCheck the URL metadata
A data URL without a media type defaults to text/plain;charset=US-ASCII, not an image type. For an image, explicitly identify its media type, such as image/png or image/jpeg. If the image does not render, check the MIME type, the comma, and whether the encoded text really corresponds to the file’s bytes.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
Choose between a file path and a data URL
| Question | Image file referenced by URL | Image embedded as a data URL |
|---|---|---|
| Must the HTML be standalone? | No. The image must remain available at the referenced path or URL. | Yes, the image data is carried in the HTML document. |
| Best fit by image size | Suitable for ordinary page assets, including larger images. | Most useful for small images; large encoded data makes the source cumbersome. |
| Reuse across pages | One image file can be referenced by multiple pages. | The image data must be included wherever it is needed. |
| Updating the image | Replace or update the image resource without rewriting its data into the HTML. | Regenerate and replace the encoded data in the HTML. |
| Responsive image selection or format fallback | Works naturally with srcset, sizes, and <picture>. |
Not the usual choice when the browser should select among image resources. |
Offer responsive sizes and format alternatives
When different screens should receive different image sizes, use srcset and sizes to give the browser candidate resources and information about the image’s expected display width. These attributes do not combine unrelated pictures; the candidates should represent the same image at suitable resolutions or widths.
<img
src="photo-800.jpg"
srcset="photo-400.jpg 400w, photo-800.jpg 800w, photo-1200.jpg 1200w"
sizes="(max-width: 600px) 100vw, 600px"
alt="A red canoe beside a wooded shore"
width="1200"
height="800">
With width descriptors such as 400w, use sizes to describe the rendered slot. Width descriptors and density descriptors such as 2x are different forms of srcset; do not mix the two descriptor types in one srcset.
Use <picture> with one or more <source> elements when you want format alternatives or different crops under different conditions. Keep the fallback <img> inside the <picture>, and put the alternative text on that <img>:
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
<picture>
<source srcset="photo.avif" type="image/avif">
<source srcset="photo.webp" type="image/webp">
<img src="photo.jpg" alt="A red canoe beside a wooded shore" width="1200" height="800">
</picture>
The browser can use a supported source and fall back to the JPEG image. Select formats based on the image and the environments you need to support: JPEG is commonly used for lossy photographic stills, PNG for precise lossless reproduction or transparency, SVG for scalable vector artwork, and WebP or AVIF for modern compressed image delivery. Browser support changes, so check current compatibility guidance if older or specialized environments matter to your project.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot an image that does not appear
- Check the path from the HTML file. Confirm the file exists at the relative location in
src, or that the absolute URL is correct and reachable. Recheck capitalization, spelling, folders, and what was actually deployed. - Check the image itself. An unsupported format, corrupt file, or empty or incorrect URL can prevent rendering. Verify that the resource is a valid image and that its URL opens as expected.
- Check every part of a data URL. Include the metadata, comma, correct image MIME type, and
;base64marker when the data is base64-encoded. Replace any instructional placeholder with the actual encoded bytes. - Check responsive descriptors. If using width descriptors such as
400w, include an appropriatesizesvalue. Do not mix width and density descriptors in the samesrcset. - Check the alternative text. A missing or unhelpful
altvalue leaves people who cannot see or load an informative image without its meaning. Use a meaningful description for informative images andalt=""for decorative ones.
A data URL does not inherit the surrounding page’s origin in modern browsers. Do not treat inline image data as a way to bypass browser origin or security boundaries.
Or skip the browser setup
If the image you need is a screenshot of a web page rather than an existing image file, ScreenshotNeo can return a screenshot or PDF from one GET request. This is separate from embedding an image in HTML: the call below saves a screenshot file, which you can then reference with an <img> path or encode as a data URL if you specifically need a self-contained document.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request details. ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots per month with no card, and paid plans start at $5 for 3,000. Learn more at ScreenshotNeo. Sign up free for 1,000 screenshots a month, with no card required.
Free tools Windows power users keep installed
One-click scans. No signup required.
Frequently Asked Questions
Can I embed an image without using base64?
Yes. For a normal page, use an <img> element whose src points to an image file by relative path or absolute URL.
Does a data URL make an image load from a separate file?
No. A data URL carries encoded image data in the HTML attribute, so the document does not need a separate image file for that image.
Should I use a data URL for a large photo?
Usually not. It makes the HTML substantially larger and harder to maintain; reference an image file instead.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.

