Home › Image Tools › BlurHash Generator

BlurHash Generator

Turn any image into a tiny BlurHash or ThumbHash string that shows a soft, colorful preview while the real photo loads. Adjust the components, compare the decoded placeholders with the original and copy ready-to-use code. Everything runs in your browser.

Last updated:

Sample image loaded. Choose your own to encode it.

Original
BlurHash
ThumbHash

    
Decode an existing BlurHash or ThumbHash

Advertisement
Advertisement

How to use the BlurHash Generator

  1. Choose an image or drop one into the box. A sample sunset is loaded so you can see the result right away.
  2. Set the components. 4 × 3 is the usual choice for landscape photos; more components keep more detail but make the string longer.
  3. Compare the previews of the original, the BlurHash and the ThumbHash, and adjust Punch if the placeholder looks too flat.
  4. Copy the hash to store it next to the image in your database or API.
  5. Copy the code for your framework, or download the placeholder as a small PNG.

BlurHash string length by component count

A BlurHash always contains 1 character for the component count, 1 for the maximum AC value, 4 for the average color (the DC term) and 2 for every other component, so length = 4 + 2 × X × Y.

Components (X × Y)CharactersGood for
1 × 16Just the average color
3 × 322Square thumbnails and avatars
4 × 328Landscape photos (the common default)
3 × 428Portrait photos
5 × 444Hero images where more structure helps
9 × 9166Maximum detail (rarely needed)

How the encoding works

  1. The image is scaled down and each pixel is converted from sRGB to linear light.
  2. For every component pair (i, j) the encoder sums each pixel multiplied by cos(π·i·x / width) × cos(π·j·y / height). This is a small discrete cosine transform, the same idea used inside JPEG.
  3. The first factor is the average color. The others are scaled against the largest one and quantized to 19 levels per color channel.
  4. Everything is written with an 83-character alphabet that is safe in JSON, URLs and HTML attributes.

ThumbHash works in a similar way but converts the colors to a luminance and two color-difference channels first, gives luminance more detail than color, and packs the result into bytes that are usually shown as base64.

Tips for great placeholders

  • Always reserve the image's space with width and height or CSS aspect-ratio, so the layout does not jump when the photo arrives.
  • Generate the hash once when the image is uploaded and store it in your database. Decoding is fast; encoding on every page view is wasteful.
  • Fade the real image in over the placeholder with a short CSS opacity transition for a smooth effect.
  • For a single static page, a small inline data URL from the Image to Base64 tool is an alternative, but it is much longer than a hash.

Frequently asked questions

What is a BlurHash?

BlurHash is a compact way to describe a blurry version of an image as a short text string, typically 20 to 30 characters. The image is broken into a few cosine waves (similar to how JPEG works), and their colors are stored in a base 83 alphabet. An app or website decodes the string into a soft gradient placeholder that is shown until the real image finishes loading.

How many components should I use?

The components set how many color waves are kept horizontally and vertically. 4 × 3 works well for most landscape photos and 3 × 4 for portraits. Fewer components give a smoother, more abstract blur and a shorter string; up to 9 per axis keep more structure. The string length is 4 + 2 × X × Y characters, so 4 × 3 gives 28 characters.

What is the difference between BlurHash and ThumbHash?

ThumbHash is a newer format that stores a similar blurred preview in about 20 to 30 bytes. It keeps more detail for its size, supports transparency and records the image's approximate aspect ratio inside the hash, while BlurHash needs the width and height stored separately. BlurHash has wider library support across web and mobile frameworks.

How do I use a BlurHash with Next.js Image?

The Next.js Image component expects a data URL in blurDataURL rather than a hash. This tool decodes the BlurHash into a small PNG and gives you that data URL, ready to paste with placeholder set to blur. For many images, store the hash and decode it on the server or at build time.

Is the encoded hash the same as other BlurHash libraries produce?

It follows the published BlurHash algorithm, including sRGB to linear conversion and the base 83 encoding, so the strings decode correctly in any standard library. The image is first scaled down to at most 64 pixels on its longest side, which is common practice; libraries that encode a different size may produce a slightly different but equivalent string.

What does the punch setting do?

Punch multiplies the strength of the color waves when the hash is decoded. Values above 1 make the placeholder more contrasty and saturated; values below 1 make it softer. It does not change the hash itself, only how it is drawn.

Are my images uploaded?

No. Both encoders run in JavaScript on your device. The image is never sent to a server, so you can use the tool for private or unreleased pictures.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Placeholder Image GeneratorCreate placeholder images in any size, color and text as PNG, JPG, WebP, SVG or data URI.Image CompressorShrink images to a target size like 100 KB.Image Format ComparisonCompress one image as JPG, WebP, AVIF and JPEG XL at the same quality and compare size and detail.Meme GeneratorMake memes with classic templates and custom text.Logo MakerDesign a text logo with fonts, icons and colors, then save SVG or PNG.Certificate MakerDesign certificates from templates and export one or many as PDF.GIF MakerTurn videos and images into GIFs, trim and compress.Business Card MakerDesign business cards and download a print-ready PDF.Flyer MakerDesign printable and social media flyers from free templates.Poster MakerDesign posters in A0–A5 and US sizes and download a print-ready PDF.Invitation Card MakerCreate printable birthday, wedding and party invitations for free.Thumbnail Safe ZonePreview YouTube and TikTok thumbnail safe zones.Thumbnail MakerDesign 1280×720 YouTube thumbnails with templates, bold text and stickersWallpaper GeneratorCreate gradient and pattern wallpapers sized for any phone, tablet or desktopYouTube Thumbnail GrabberPaste a YouTube link to get every thumbnail size, from HD 1280x720 down to 120x90.CSS Gradient GeneratorDesign linear, radial and conic CSS gradients with draggable stops and export CSS or PNG.Chart MakerMake bar, line, area, pie and doughnut charts from a simple table and download PNG or SVG.Venn Diagram MakerMake 2- or 3-circle Venn diagrams from lists; overlaps are found for you. Export PNG or SVG.Mind Map MakerBuild mind maps fast with keyboard shortcuts and auto layout, then export PNG, SVG or JSON.Org Chart MakerType an indented list of names and titles and get a clean org chart to download as PNG or SVG.Timeline MakerCreate horizontal or vertical timelines from dated events with colors, then save PNG or SVG.Gantt Chart MakerPlan tasks with dates, progress and dependencies on a Gantt chart, then export PNG or CSV.Word Cloud GeneratorTurn any text into a word cloud in shapes like a heart or star, then save it as PNG or SVG.Pie Chart MakerMake pie and donut charts with labels, percentages and a legend, then download PNG or SVG.Favicon GeneratorMake a favicon.ico, PNG icons, apple-touch-icon and web manifest from an image, text or emoji.Passport Photo MakerMake passport and visa photos for any country and print them on a 4x6 sheet.Signature MakerDraw or type your signature and download it as a transparent PNG or SVG.Quote Image MakerTurn a quote into a shareable image for Instagram, Stories or X with backgrounds and fonts.Profile Picture MakerMake a round or square profile picture with a ring border and color or gradient background.Before and After Image MakerCombine two photos into a labeled before and after image or an animated slider video.Device Mockup GeneratorPut a screenshot into a phone, tablet, laptop, monitor or browser frame and download a PNG.Seamless Pattern GeneratorMake seamless dot, stripe, wave, grid, zigzag and check patterns. Export CSS, SVG or PNG.3D Text GeneratorRender extruded 3D text with depth, bevel, materials and rotation; export a transparent PNG.Album Cover MakerDesign 3000×3000 album and podcast cover art with photo filters and type presets.Animated Text GIF MakerCreate animated text GIFs with typing, blink, bounce, rainbow or scroll effects; GIF or WebM.App Icon GeneratorMake every iOS, Android adaptive, PWA and macOS app icon size from one image, as a ZIP.Birthday Card MakerMake a printable folded birthday card from templates with photos, stickers and fonts; PDF or PNG.Chalkboard Sign MakerDesign chalkboard-style menu and event signs with hand-lettered fonts and doodles; PNG or PDF.Deck DesignerDesign a deck to scale with joists, beams, posts, stairs and board layout; PNG and list.DICOM ViewerOpen DICOM .dcm medical images in your browser, adjust window/level, read tags and export PNG.Lean Canvas GeneratorFill in the 9 Lean Canvas boxes and get a clean one-page canvas as PNG, JPG or PDF.Loyalty Punch Card MakerDesign business-card-size stamp cards with your logo and reward, then print a sheet as PDF.Normal Map GeneratorTurn a texture photo into normal, height, roughness and AO maps with a live 3D preview.Pregnancy Announcement MakerMake a pregnancy announcement image with a letter board, ultrasound photo and due date.Price Tag MakerMake printable price tags and shelf labels with sale prices and strike-through, on a cut-ready sheet.Risk Matrix GeneratorPlot named risks on a 3×3, 4×4 or 5×5 likelihood × impact heat map; export PNG, PDF or CSV.Stereogram GeneratorMake Magic Eye style 3D autostereograms from text, shapes or your own depth map.vCard QR Code GeneratorTurn contact details into a vCard QR code and a printable business card. PNG or SVG.Wedding Program MakerDesign printable wedding programs: folded, fan or tea-length, with order and party, PDF.Welcome Sign MakerMake wedding, shower and party welcome signs with names and date; poster-size PNG or PDF.Tiny Planet MakerTurn a 360° panorama into a tiny planet or rabbit hole photo with rotation, zoom and tilt.Recolor PNG IconChange the color of PNG icons and logos to any color or gradient, keeping transparency.Book Cover MakerDesign ebook and print book covers with trim sizes, spine width from page count, PNG/PDF.Brochure MakerMake tri-fold or bi-fold brochures from templates with panel guides and a two-sided print PDF.Comic Strip MakerMake comic strips with panel layouts, speech bubbles, captions and drawings; export PNG.Family Tree MakerBuild a family tree with people, dates and photos; auto-layout, save JSON, export PNG/PDF.Flowchart MakerDrag-and-drop flowcharts with standard shapes, connectors and snap grid; PNG/SVG/JSON.Gift Tag MakerDesign printable gift tags with holiday themes and to/from names, many per page with cut lines.Initials Avatar GeneratorCreate letter avatars from names: shapes, colors, fonts, bulk ZIP, PNG/SVG and data URIs.Instagram Story MakerDesign 1080×1920 Instagram stories with templates, photos, text, stickers and safe-zone guides.Label MakerDesign jar, address, shipping and product labels and print them on Avery-style sheets or PDF.Low Poly GeneratorTurn a photo or a random gradient into low-poly triangle art. Download PNG, JPG or SVG.Seamless Texture MakerMake any image tileable with offset blending, edge cross-fade or mirroring, with a tiled preview.Mesh Gradient GeneratorDrag color points to make smooth mesh and aurora gradients with grain, then export PNG or CSS.Motivational Poster MakerMake a classic black-border motivational or funny demotivational poster from your photo.Name Tag MakerMake printable name badges in bulk from a list of names, titles and companies as a PDF.Neon Text GeneratorMake glowing neon sign text on brick or dark walls, with flicker, and save it as PNG or GIF.
See all 142 Design & Graphics Makers →