Nutter Tools
Nutter Tools

A free toolbox that runs in your browser. A tool for every job.

Your files never leave your device

Images

  • Convert images
  • Compress images
  • Resize images
  • Crop
  • Watermark

PDF & files

  • Merge PDFs
  • Split a PDF
  • Images to PDF
  • PDF to images
  • Remove photo location

Video & audio

  • Compress video
  • Convert video
  • Video to GIF
  • Convert audio
  • Trim audio

Everyday

  • QR codes
  • Passwords
  • Time zones
  • Unit converter
  • Word count
  • Webcam test

Developer

  • JSON formatter
  • Base64
  • Regex tester
  • Hashes
  • JWT decoder

Site

  • About
  • Contact
  • Settings
  • Privacy
  • Terms
  • Site map
  • llms.txt

Everyday

  • Images
  • Video
  • Audio
  • PDF & files
  • Text
  • QR codes
  • Units & math
  • Time & dates
  • Color
  • Passwords & IDs
  • Device tests
  • Sun & moon

For developers

  • JSON
  • Encoding
  • Regex & cron
  • Web & auth
  • Hashing & encryption
  • Config files
  • Network
  • Browser
  • AI
  • Fake data
© Nutter Toolsnutter.tools
  1. Home
  2. Regex & cron
  3. Morton code calculator
Your files stay on your device

Morton code calculator

Interleave the bits of two 16-bit coordinates into a Morton code, or decode a code back to x and y, with the binary interleaving shown.

This tool is in beta

Still being tested. If a result looks wrong, tell us.

Report a problem

Enter x and y to interleave them.

The Z-order curve interleaves bits so that nearby coordinates land in nearby codes, which is why spatial indexes and geohash-style tiles use it. The property is one-directional in practice: points that are close in space get close codes, but close codes can also come from distant points across a Z boundary, so equal codes never mean equal neighbors. This page does plain bit math in one direction at a time, in this tab, with nothing fetched.

Coordinates

ModeExplicit direction, so nothing loops back into itself

X and Y are 16-bit: 0 to 65,535, whole numbers, no negatives. The code is the 32-bit interleave. Switching mode feeds the current result back in as the input.

More regex & cron tools

  • Base64
  • UUID generator
All regex & cron tools

Was this tool useful?