# Understand encoded/decoded data

Hi, i’m new here.
I have a json map and I’m trying to decode the data string.
I’m sure it’s decoded right since it has a lot of zeros and 6 numbers that represent the object I put.

My problem is that those numbers are something like this 1258946560 and i have no idea why since the tile ID is 208.
That’s the string for this layer

``````AAAAAAAAAAAAAAAAAAAAAEsKAABMCgAATQoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABbCgAAXAoAAF0KAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAawoAAGwKAABtCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
``````

I would like to know how i can understand those number better and maybe how TILED goes from a single tile to a number like this (for a single tileset or multiple in one layer).
I have to change dynamically the tiles but since I don’t understand those numbers is hard to reference the right tileset and specific tile.

The global tile IDs include the flip flags in them, which is how you know which way the tile is flipped or rotated. To decode them, you need to extract those, and then figure out which tileset the tile belongs to based on its global ID and your tilesets’ `firstgid`s. Then, you subtract the appropriate `firstgid` from the tile ID to give you the tileset-local ID of the tile, which you can use to render the tile and get its properties.

Edit: The number you provided isn’t a valid GID with flags though. If that’s the actual number you saw and not just a keysmash, it’s possible you haven’t finished decoding the map. In addition to a base64 decode, you may need to do a decompression with the method appropriate to whatever `compression` method is set on the map.
If it was base64 uncompressed and your Tile Layer Format was actually set to that, then your decoding should be done, and all that’s left is to deal with the flags and `firstgid`s.