svgtgs

What is a TGS file?

4 min read · updated 2026-07-05

TGS is the file format behind Telegram’s animated stickers. Technically it’s simple: take a Lottie animation (the JSON format exported from After Effects by Bodymovin), compress it with gzip, add a "tgs": 1 marker, and rename it to .tgs. Telegram renders it with rlottie, a fast native Lottie player.

The hard limits

PropertyStickerCustom emoji
Canvasexactly 512 × 512exactly 100 × 100
File size (gzipped)≤ 64 KB≤ 64 KB
Duration≤ 3 seconds≤ 3 seconds
Frame rate30 or 60 FPS
Loopingplays in a loop automatically

On top of the numeric limits, rlottie supports a subset of Lottie: no expressions, no raster images, no text layers, no 3D. Vector shape layers with fills, strokes, gradients, trim paths, and masks are all safe — which is exactly the subset an SVG converts into.

Why Telegram chose vectors

A typical animated TGS is 10–40 KB — smaller than a single frame of an equivalent GIF. It stays razor sharp on any screen density, animates at a full 60 FPS, and decodes fast enough for a chat full of stickers to play simultaneously on a mid-range phone.

Creating a TGS file

The official route is After Effects + Bodymovin with Telegram’s export preset. The fast route, if your art is vector already: convert an SVG directly with svgtgs — it builds the Lottie shape layers, applies your chosen animation preset, validates every limit above, and gzips the result. See how to convert SVG to TGS.

Questions

How do I open a TGS file?

Send it to any Telegram chat to preview it, or decompress it with gzip to get Lottie JSON that plays in any Lottie player. To create one from vector art, use an SVG to TGS converter like svgtgs.

How is TGS different from a GIF?

TGS files are vector animations — a few kilobytes, perfectly sharp at any size, always 60 FPS. GIFs are compressed raster frames: bigger, blurrier, and capped by palette limits.

Can I convert TGS back to SVG?

Not directly — TGS stores Lottie shape data, not SVG markup. You can unzip it to JSON and inspect the shapes, but round-tripping to editable SVG loses animation data.

Ready to try it?

The converter is free and runs entirely in your browser.

Convert an SVG now

Keep reading