Tilemap editor
This tilemap editor paints a grid map from a tileset in your browser with three layers, fill and erase, exports a PNG, a JSON file for your game and Tiled's JSON format, and lets you play the map as a platformer before you build anything.
40 × 16 cells of 16 pixels · 176 tiles placed · start at column 2, row 13 · goal at column 39, row 12
Tiles · tile 0
Layers
- Background
- Ground (solid)
- Details
Map size
Your own tileset
Export
The sample map is loaded: paint on it, or press Play this map.
What the files contain
Map JSON
The sample map is 40 × 16 cells of 16 pixels with 3 layers, 176 tiles placed and 139 solid cells, and its JSON is 6,040 characters. Each layer is 16 rows of 40 numbers: -1 is an empty cell and any other number is a tile counted from 0 through the tileset (16 tiles in the editor's own set). Maps run from 8 × 6 to 120 × 60 cells.
Tiled JSON
It follows the Tiled JSON map format: one flat list of tile ids per layer, counted from 1 with 0 meaning empty, and one tileset entry. The sample is 4,800 characters in that form. Tiled opens it next to the tileset PNG, and loaders written for Tiled maps read it.
Layers
Background holds sky and water, Ground is solid, and Details holds trees, signs and flowers. Hide a layer to see what is under it, and tick Solid on any layer to make it count for collision. The Solid flag is saved with each layer.
Your own tileset
Choose a PNG, set the tile size from 8 to 64 pixels, and the editor cuts it into a grid of up to 1,024 tiles. The map, the exports and Play this map all use it. Nothing leaves your browser tab.
Play the map before you build the game
What Play this map does
It turns the current map into a side-view platformer: gravity of 38 tiles a second squared, a jump that leaves the ground at 14 tiles a second and reaches 2.6 tiles high, and a top running speed of 7 tiles a second. Run, jump and reach the orange flag. Layers marked Solid are the floor, and the map edges are walls on the left and right.
Finding out early whether it can be finished
A search over the same physics, trying every combination of left, right and jump, reaches the flag of the sample map in about 5.5 seconds. A gap wider than 5.2 tiles, or a ledge more than 2.6 tiles above the last one, shows up in your first run. The player is a small platformer written for this page; the prompt below has Claude Code load the same file into the kit's platformer starter.
Load the JSON in a game
Draw every layer in order, skip -1, and read the solid flag for collision. The map and the tileset PNG travel together:
const map = await (await fetch("./tilemap-40x16.json")).json();
const sheet = await createImageBitmap(await (await fetch("./tileset.png")).blob());
const T = map.tileSize, cols = map.tileset.columns;
for (const layer of map.layers)
layer.data.forEach((row, y) => row.forEach((id, x) => {
if (id < 0) return; // empty cell
ctx.drawImage(sheet, (id % cols) * T, Math.floor(id / cols) * T, T, T, x * T, y * T, T, T);
}));
player.x = map.start.x * T; player.y = map.start.y * T; // layers with solid: true are the floorTo have Claude Code build the level from the files, paste a prompt like this one in a session that has the starters installed. The tiles can be recolored first in the pixel art palette tool, and a walking character comes from the sprite animation maker.
Read tilemap-40x16.json and tileset.png. Build the level in the platformer-2d starter: draw every layer from the tileset, treat layers with solid: true as collision, start the player at start and end the round when the player touches goal. Keep the starter's controls, play it, and check that the player can reach the goal.Other tilemap editors
Tiled is the open source desktop level editor most engines have a loader for. It has object layers, infinite maps, automapping and terrain brushes, and it exports to JSON, Lua and other formats. This page writes its JSON format, so a map you start here opens in Tiled.
Godot's built-in tile map editor opens in the bottom panel when you select a TileMapLayer node that has a tileset, and Phaser Editor has an editable tilemap object inside its scene editor. This page needs no setup, writes plain JSON for any game, and plays the map in place.
Questions
How do I make a tile map?
Pick a tile from the tileset, choose a layer and paint on the grid with the Brush. Use Fill for large areas and Erase to clear a cell. Put the Start and Goal markers where the player begins and ends, then press Play this map to run it and Map JSON to save it.
What file does the tilemap editor export?
Map PNG draws the map at 1, 2 or 4 times its size. Map JSON is a list of rows of tile numbers for each layer, with the tile size, the tileset and the start and goal cells. Tiled JSON writes the same map in Tiled's own JSON map format, so Tiled and every loader for it can open it. Tileset PNG saves the tile picture both files point to.
Can I use my own tileset?
Yes. Choose a PNG, JPEG or WebP, set the tile size to 8, 16, 24, 32, 48 or 64 pixels, and the editor cuts it into a grid, up to 1,024 tiles. Every tile in the old set that does not exist in the new one is cleared from the map. Nothing is uploaded; the image stays in your browser tab.
What do the Solid checkboxes do?
A layer marked Solid is the floor and the walls: the player stands on it and cannot walk through it. Background and Details layers are only for looks. The Solid flag is saved in the JSON for each layer, so your own game can read the same rule.
How do I load the map in my game?
Fetch the JSON, loop over each layer's rows, and draw the tile for every number that is not -1 from the tileset image: the tile's column is the number modulo the tileset columns and its row is the number divided by them. The snippet below does it in a few lines of canvas code.
Put your assets into a playable game. Try the ten game templates or get the kit.