C# library for parsing and importing TMX and TSX files generated by Tiled, a tile map generation tool
Latest commit b4f9599 Oct 27, 2016 3 @marshallward Removal of `DotNetZip`; explicit zlib deflate
This patch removes the `zlib` source from TiledSharp and relies on
intrinsic .NET libraries to decompress gzip and Zlib streams.  Since
.NET does not have explicit Zlib support, we manually strip the header
and footer, and use the `DeflateStream` on the body.



A .NET C# library for importing Tiled TMX tile maps

Note to current users

I am considering some minor changes to the TiledSharp API. See the GitHub issue for more information.

About TiledSharp

TiledSharp is a .NET C# library for importing TMX tilemaps and TSX tilesets generated by Tiled, a tile map generation tool. The data is saved as a TmxMap object, whose structure closely resembles the original TMX file.

As a generic TMX and TSX parser, TiledSharp does not render the maps or depend on any external framework beyond .NET, such as Windows, XNA/MonoGame, Unity, or PSM. However, it can be used as an interface between TMX data and external games.


To import a TMX file into your C# application:

  • Include a reference to TiledSharp. You can either incorporare it directory into your own project, or you can pre-compile it and include the DLL.

  • Import the TiledSharp namespace (optional):

    using TiledSharp;
  • Create a Map object using the constructor:

    var map = new TmxMap("someMap.tmx");

    TiledSharp supports both resource names and file paths, and should work as expected in most situations. For more details, please consult the wiki.

  • Access the TMX data using the Map fields. Principal classes can be accessed by either name or index:

    var map = new TmxMap("someMap.tmx");
    var version = map.Version;
    var myTileset = map.Tilesets["myTileset"];
    var myLayer = map.Layers[2];
    var hiddenChest = map.ObjectGroups["Chests"].Objects["hiddenChest"];

Map data fields correspond closely to the TMX file structure. For a complete listing, see the documentation.

Although TiledSharp can manage elements with the same name, it is not recommended. For more information, see the TmxList specification.



TiledSharp parses XML files produced by Tiled, an open-source (GPL) tile map editor developed and maintained by Thorbjørn Lindeijer.

Zlib decompression in TiledSharp uses the Zlib implementation of DotNetZip v1.9.1.8. Minor modifications were added for use on Android and iOS.


TiledSharp is distributed under the Apache 2.0 License. The code can be used freely in any project, including commercial software, and does not place any restrictions on your own code. But any changes to TiledSharp must be documented explicitly.

Attribution is not necessary, but always appreciated.

Support code from DotNetZip is distributed under the Microsoft Public License.


Marshall Ward <tiledsharp@marshallward.org>