iToolsPro

Hilbert Curve

Generate the space-filling Hilbert fractal curve - adjustable order & colors, export PNG

Settings
4
1.0×
Tip: all processing is local, nothing is uploaded. Higher orders get denser (order 8 has 65,536 nodes).
Preview
Checkerboard marks transparent areas; export on a transparent background to overlay anywhere.
Fractal · Space-filling · Export

One line, fills the whole plane

Recursively generate the space-filling Hilbert curve - adjust order 1-8, rainbow gradient or solid, optional grid and node markers, export transparent PNG. All local, nothing uploaded.

100% local · nothing uploaded

Features

Adjustable order
Order 1-8: side length 2ⁿ, node count 4ⁿ - watch the fractal subdivide level by level.
Gradient colors
Rainbow gradient along the curve, or a solid color; line width adjustable.
Transparent export
Export a transparent PNG ready for posters, wallpapers or presentations.

Use cases

🎨 Math art 🖼 Wallpapers 📐 Teaching 🧠 Algorithm viz

希尔伯特曲线工具指南Hilbert Curve Guide

了解分形原理、阶数与常见问题。Fractal basics, order levels, and answers to common questions.

功能说明What It Does

希尔伯特曲线是一种空间填充曲线,能用一条连续折线经过正方形区域内所有格点。本工具按阶数递归生成 4ⁿ 个节点并用折线连接,支持彩虹渐变或单色、网格与节点标记,导出透明 PNG。

The Hilbert curve is a space-filling curve that visits every point of a grid in one continuous polyline. This tool generates 4ⁿ nodes recursively by order, links them, supports gradient or solid colors plus grid and node markers, and exports a transparent PNG.

全部在浏览器本地完成,数据不会上传。

Everything runs locally in your browser - nothing is uploaded.

阶数说明About the order

阶数 n 对应边长 2ⁿ、节点数 4ⁿ。1 阶是 2×2 的「门」形,2 阶 4×4,每加一阶曲线细分一层。8 阶含 65536 个节点,已接近填充整个平面。

Order n gives a 2ⁿ by 2ⁿ grid with 4ⁿ nodes. Order 1 is a 2×2 "U" shape, order 2 is 4×4 - each level subdivides once. Order 8 has 65,536 nodes, nearly filling the plane.

使用步骤How to Use

  1. 调整阶数(1-8),观察曲线逐级细分。Adjust the order (1-8) to see the curve subdivide.
  2. 选择渐变 / 单色、粗细、网格与节点。Pick gradient or solid, thickness, grid and nodes.
  3. 满意后「导出PNG」。Click "Export PNG" when happy.

常见问题FAQ

Q1. 曲线会相交吗?Q1. Does the curve self-intersect?

不会。希尔伯特曲线是自避免的:每个格点恰好经过一次,折线不相交。No - the Hilbert curve is self-avoiding: every grid point is visited exactly once, with no crossings.

Q2. 高阶会不会卡?Q2. Will high orders be slow?

8 阶 65536 节点本地绘制流畅,渐变按段批量上色,不会卡顿。Order 8 (65K nodes) renders smoothly locally; gradients are batched by segment.

Q3. 节点标记适合几阶?Q3. Which orders suit node markers?

建议 1-4 阶显示节点;高阶节点过密,建议关闭以保持清晰。Use node markers for orders 1-4; at high orders they get too dense - keep them off.