Free online tools to generate, calculate,
convert, format, encode, and play.
 

Hilbert Curve Generator

Generate and visualize Hilbert space-filling curves with adjustable depth, colors, and line width. The curve is rendered in real time on an HTML canvas.


Preview

Controls


About the Hilbert Curve

The Hilbert curve is a continuous space-filling curve that visits every point in a square grid. It was first described by the German mathematician David Hilbert in 1891 as a variant of the space-filling curves discovered by Giuseppe Peano in 1890.

Properties
  • Hausdorff dimension: 2 -- the curve fills the entire 2D plane as the order approaches infinity.
  • Continuity: The curve is continuous and passes through every cell in a 2n x 2n grid exactly once.
  • Locality preservation: Points that are close together along the curve tend to be close together in 2D space, making it useful for spatial indexing.
Applications
  • Database indexing: Used in spatial databases (R-trees, B-trees with Hilbert ordering) for efficient multidimensional queries.
  • Image processing: Dithering, texture mapping, and scan ordering for cache-friendly memory access.
  • Dimensionality reduction: Mapping multidimensional data to one dimension while preserving locality.
  • Computer graphics: Efficient traversal of image pixels for rendering and compression.

Embed This Util

You can embed this util on your own site as a widget. Adding ?embed=1 to the URL loads a compact version with just the tool itself; no header, menu, or documentation. Paste this snippet into your HTML:


    

Copy snippet Adjust the height to taste.



Feedback

Help us improve this page by providing feedback, and include your name/email if you want us to reach back. Thank you in advance.


Share with