Image Hash Generator
Generate cryptographic and perceptual hashes of an image.
Turn an image into a ready-to-paste CSS background rule.
Drop an image here, or click to choose one
JPEG, PNG, WebP, GIF or SVG · processed on your device, never uploaded
Image to CSS Background writes the complete background rule — size, position, repeat and attachment in the right order — and offers the image either as a url() reference or inlined as a data URI, with the size of each shown so the choice is a number rather than a guess.
Writing a background rule by hand means remembering the order of background-size, position and repeat, and then deciding whether the image should be a separate request or inlined.
Both are handled here. The rule is generated with the properties you actually chose, in the right order, and the image is offered either as a normal url() reference or inlined as a data URI. The tool is explicit about when inlining is worth it: below about 5 KB the saved request usually wins, above it the 33 percent Base64 overhead and the loss of separate caching do not. The size of both versions is shown so the decision is a number rather than a guess.
A file reference and an inlined data URI, with the byte cost of each so the trade-off is visible.
Under about 5 KB the saved request wins; above it the 33 percent overhead and lost caching do not.
Size, position and repeat are shown applied to a real box, which is faster than guessing at cover versus contain.
The rule is assembled properly rather than left for you to remember.
The page is clear that content images belong in an img tag where they can be described and lazy-loaded.
Anything you intend to use as a background.
Size, position, repeat and attachment, with a live preview.
The size of each is shown so the trade is visible.
Paste it straight into your stylesheet.
When it is under about 5 KB and always needed — an icon or a small texture. Base64 adds 33 percent and the image can no longer be cached separately from the CSS.
Cover fills the element and crops the overflow; contain fits the whole image inside and may leave gaps. Cover is right for hero backgrounds, contain for logos.
Usually the element has no height. A background needs a box to paint into, so give the element a height, padding or content.
An img tag when the image is content — it can be described for screen readers and lazy-loaded natively. A background when it is decoration.
What people who use the Image to CSS Background think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the Image to CSS Background. It takes half a minute and no account.
Write the first reviewGenerate cryptographic and perceptual hashes of an image.
Pack icons into one sprite sheet with the CSS classes.
Find the single average colour of an image.
Find where a photo was taken, from its own metadata.
Trace a bitmap into scalable vector paths.
Fix exposure with brightness, contrast and gamma.
Put a coloured border or frame around any photo.
Arrange several photos into a clean grid collage.