# Z-fractal

## World's simplest fractal tool

This utility lets you draw custom and colorful Morton z-fractals. You can explore the fractal's behavior by recursively iterating it as many times as you want and changing its size in the options. You can also customize the thickness and color of the drawing pen, as well as adjust the color of the background. A curious fact – with each iteration, the number of z letters in the fractal quadruples. Fractabulous!

love numbers?
check out number tools!

We also have Online Number Tools — utilities for doing numbery things. Check it out!

A link to this tool, including input, options and all chained tools.

Can't convert.

Z-fractal tool
What is a z-fractal?

This online browser-based tool allows you to create a custom Morton fractal. The Morton fractal, named after Guy Macdonald Morton (G.M.Morton), was first investigated in 1966. The Morton fractal is also called the z-fractal because it consists of a sequence of connected letters z, which fills the entire space. It's often used in data algorithms as it maps multidimensional data to one dimension while preserving locality of the data points. Ingenious and mind blowing at the same time, or as we love to say – fractabulous!

Z-fractal examples
Click to use

Four Iterations of Morton Fractal

In this example, we create a 4th-order z-order curve on a square canvas of 800x800 pixels. To do this, we use a 4-pixel pen and draw a white line on a catalino-blue background.

**Required options**

Iterate fractal this many times.

Fractal space width.

Fractal space height.

Pen width for drawing the
fractal's curve.

Pen color.

Fill fractal's background
with this color.

Indent around Morton's fractal.
(Adds this many empty pixels
to left, right, top, bottom sides.)

Norton's Fractal

In this example, we set the orientation for Morton fractal to vertical. As a result, all letters z are flipped on the side. This fractal is also called Norton fractal curve (a pun on Morton's name) because all z's are now n's.

**Required options**

Iterate fractal this many times.

Fractal space width.

Fractal space height.

Pen width for drawing the
fractal's curve.

Pen color.

Fill fractal's background
with this color.

Indent around Morton's fractal.
(Adds this many empty pixels
to left, right, top, bottom sides.)

Rectangular Morton Fractal

This example uses a rectangular space with a size of 800 by 1200 pixels to draw a z-order fractal. It calls the drawing algorithm recursively five times, which means there are 256 letters "z". (In general there are 4^(n-1) "z" letters for recursive depth "n".)

**Required options**

Iterate fractal this many times.

Fractal space width.

Fractal space height.

Pen width for drawing the
fractal's curve.

Pen color.

Fill fractal's background
with this color.

Indent around Morton's fractal.
(Adds this many empty pixels
to left, right, top, bottom sides.)

Pro tips
Master online fractal tools

You can pass options to this tool using their codes as query arguments and it will automatically compute output. To get the code of an option, just hover over its icon. Here's how to type it in your browser's address bar. Click to try!

https://onlinefractaltools.com/draw-morton-fractal?&iterations=4&width=800&height=800&line-width=4&line-segment-color=white&background-color=%23082585&padding=15&direction=horizontal

All fractal tools

Quickly draw a custom Gosper fractal.

Quickly draw a custom Z-order fractal.

Quickly draw a custom Hilbert fractal.

Quickly draw a custom binary v-fractal.

Quickly draw a custom Peano fractal.

Quickly draw a custom Heighway dragon fractal.

Quickly draw a custom twin dragon Heighway fractal.

Quickly draw a custom Heighway nonadragon fractal.

Quickly draw a custom Hausdorff tree fractal.

Quickly draw a custom Moore fractal.

Coming soon
These fractal tools are on the way

Fractal Canopy

Generate a fractal tree canopy.

Mandelbrot Tree

Generate a Mandelbrot tree fractal.

Barnsey's Tree

Generate a Barnsley's tree fractal.

Barnsey's Fern

Generate a Barnsley's fern fractal.

Subscribe!
Never miss an update

Cool!

Notifications
We'll let you know when we add this tool

Cool!