XNB to PNG converter
Get the image out of an XNB texture file for modding or reference, no unpacker install needed.
or drop them here
.xnb texture files from a game’s Content folder. Drop several at once
- Runs in your browser
- Nothing is uploaded
- No signup
- Free
.xnb files are the packed assets of games built on Microsoft’s XNA framework and its successor MonoGame, including Stardew Valley and Terraria. Textures live inside them in a raw pixel format no image viewer opens. This tool reads the XNB in your browser and writes a PNG, with the game’s premultiplied alpha corrected so transparent edges look right.
It is aimed at modders who want to study or edit a sprite sheet and at anyone curious what a given asset file contains.
How to convert XNB to PNG
- 1
Find the .xnb file
Stardew Valley:
Stardew Valley/Content/(right-click the game in Steam → Manage → Browse local files). Terraria:Terraria/Content/Images/. - 2
Drop it here
Several files at once is fine. Each becomes a PNG with its own download.
- 3
Check the format note
The tool reports the texture size and pixel format. Files it cannot handle yet say why.
What is inside the file
An XNB starts with the letters XNB, a platform letter, a version byte and a flags byte, then a list of the “type readers” needed to load the content and the content itself. For a Texture2D that is a surface format code, width, height, the number of mip levels and the pixel bytes. Many shipped games compress the body with LZX (flag 0x80); files written out by unpacking and repacking tools are usually uncompressed.
What you get
- A PNG per texture at its original pixel size, with alpha un-premultiplied
- Texture size, pixel format and mip count
Limits to know about
- LZX- and LZ4-compressed XNB files are not yet decompressed. Stardew Valley’s own Content files are mostly LZX-compressed and will be refused with a clear message until that lands. Files produced by unpack tools convert now.
- Only Color (RGBA8), Bgr565, Bgra5551, Bgra4444 and Alpha8 pixel formats are supported; DXT-compressed textures are planned.
- Non-texture XNB files (sprite fonts, sound effects, maps, dictionaries) are identified but not converted.
Privacy
This tool runs entirely in your browser. The file is read on your device by a background script, the result is built on your device, and nothing is transmitted to us or to anyone else. You can load this page, turn off your internet connection and the tool keeps working. There is no account and no quota.
Questions
Why does it say my Stardew Valley file is compressed?
Stardew ships its Content folder LZX-compressed. Decompression in the browser is being added. In the meantime, XNB unpacking tools on Windows can convert those files, and anything they write back out uncompressed converts here.
Can I convert PNG back to XNB?
Not here. Modern Stardew modding uses SMAPI and Content Patcher, which load PNGs directly and make repacking unnecessary.
Does this work for Terraria?
Yes for uncompressed Texture2D files, the same as Stardew. Terraria’s shipped images are compressed in the same way, with the same limitation.
Is anything uploaded?
No. The file is read and the PNG is drawn in your browser.