SWF File Documentation
Summary
An SWF (Small Web Format, “Shockwave Flash”) file is a compiled Adobe Flash animation, game or interactive movie: a timeline of vector graphics, bitmaps, audio and ActionScript bytecode. Its MIME type is application/x-shockwave-flash. Adobe Flash Player reached end-of-life on 31 December 2020 and is permanently blocked, so the way to open a .swf today is the free open-source emulator Ruffle, as a desktop app or browser extension.
Technical details
| Feature | Value |
|---|---|
| Full name | Small Web Format (Shockwave Flash) |
| File extension | .swf |
| MIME type | application/x-shockwave-flash |
| Format type | Binary, tag-based timeline; vectors, bitmaps, audio, bytecode |
| Developer | Adobe Systems (originally FutureWave, then Macromedia) |
| Introduced | 1996 (FutureSplash Animator) |
| Status | End-of-life; Flash Player blocks all content since 12 January 2021 |
| Open standard | Partial — spec published, now withdrawn after Flash EOL |
| Byte order | Little-endian; many fields are bit-packed |
| Signature | FWS (uncompressed), CWS (zlib), ZWS (LZMA) |
| Header | 3-byte signature, version byte, UI32 file length |
| Compression | None (FWS), zlib/DEFLATE (CWS, SWF 6+), LZMA (ZWS, SWF 13+) |
| Scripting | ActionScript bytecode: AVM1 (AS1/2), AVM2 (AS3) |
| Coordinate unit | Twip = 1/20 pixel (1/1440 inch) |
| Editable source | .fla (SWF is the compiled output; not reversible) |
| Modern player | Ruffle (open-source emulator, Rust) |
| Related extensions | .fla, .flv, .spl, .swc, .as |
| Specification | SWF File Format Specification (archived, Adobe DevNet) |
What is an SWF file?
An SWF file is the compiled, ready-to-play form of Adobe Flash content: an animation, a browser game, a video player or an interactive advertisement. The initials stand for “Small Web Format”, though the format is more often remembered by its older expansion, “Shockwave Flash”. It began in 1996 as FutureWave’s FutureSplash Animator, passed to Macromedia (which named it Flash), and then to Adobe with the 2005 acquisition. An SWF is the counterpart to the editable .fla project file: the .fla is what an author edits, the .swf is what the compiler produces and what a player runs.
An SWF is not a linear video, even though it is often filed under “video”. It is a timeline-based container of vector shapes, bitmaps, fonts, audio and ActionScript bytecode, which makes it interactive software rather than a stream of frames. That distinction matters for everything below, from how the file is structured to why you cannot simply “convert” it to MP4.
The single most important fact for anyone with an SWF today: Adobe Flash Player is dead. Adobe ended support on 31 December 2020, and since 12 January 2021 the player actively blocks all Flash content. Every browser removed the plug-in. The way to open an SWF in 2026 is Ruffle, an open-source Flash emulator, covered at the end of this article.
The 8-byte header: FWS, CWS, ZWS and compression
Every SWF begins with the same fixed header. The first three bytes are a signature that also declares how the rest of the file is compressed.
offset size field
0 3 signature "FWS" | "CWS" | "ZWS"
3 1 version SWF version number (e.g. 0x0A = 10)
4 4 fileLength UI32, little-endian, total UNCOMPRESSED length
FWS (46 57 53) means the body is uncompressed. CWS (43 57 53) means everything after byte 8 is zlib/DEFLATE-compressed, introduced with SWF 6. ZWS (5A 57 53) means the body is LZMA-compressed, added in SWF 13. In all three cases the 8-byte header is stored uncompressed, and fileLength is the size the file would have after decompression. A reader that sees CWS or ZWS inflates from byte 8, then treats the result exactly as it would an FWS body. All multi-byte integers are little-endian, and many fields are bit-packed rather than byte-aligned.
The movie header: stage size in twips, frame rate and frame count
Immediately after the 8-byte header comes the movie header, which sets up the stage. It is where SWF’s bit-packing first appears.
frameSize RECT stage bounds (Nbits + xmin,xmax,ymin,ymax), in TWIPS
frameRate UI8.8 fixed-point frames per second
frameCount UI16 number of frames on the main timeline
The frameSize is a RECT, a variable-width structure that starts with a 5-bit field saying how many bits each of the four edge coordinates uses, then packs the four values at that width. The coordinates are in twips, SWF’s internal unit of 1/20 of a pixel (1/1440 of an inch), which is what gives Flash its resolution-independent vector positioning. frameRate is an 8.8 fixed-point number, so 24 fps is stored as 0x18 0x00 read as two bytes. frameCount is the number of frames on the root timeline. After this header the body is a flat list of tags.
The tag stream: RECORDHEADER, short and long tags
The body of an SWF is a sequence of tags. Each tag is a self-describing record: a header giving its type and length, followed by that many bytes of data. This is what lets a player skip a tag it does not understand and lets the format grow without breaking older parsers, the same forward-compatibility idea used by chunked formats such as PNG.
RECORDHEADER (short):
UI16 TagCodeAndLength
upper 10 bits = tag type
lower 6 bits = length (0..62 bytes of tag data)
RECORDHEADER (long), used when length >= 63:
UI16 TagCodeAndLength (lower 6 bits = 0x3F, a flag)
SI32 length (the real length follows)
The length in the header counts only the tag’s data, not the header itself. A tag of 62 bytes or fewer uses the short form, packing type and length into a single 16-bit value. A tag of 63 bytes or more sets the low six bits to 0x3F as an escape and stores the real length in the following 32-bit integer. The file ends with an End tag (type 0), a tag with a length of zero.
Tags fall into two groups. Definition tags create content and store it in the player’s dictionary against a character id: shapes, sprites, bitmaps, fonts, sounds. Control tags manipulate the stage and drive the timeline: place a character on screen, advance a frame, run code.
| Tag | Code | Role |
|---|---|---|
End | 0 | Control — marks the end of the file |
ShowFrame | 1 | Control — renders the current frame and advances |
DefineShape | 2 | Definition — a vector shape (fills, edges) |
SetBackgroundColor | 9 | Control — the stage background colour |
DoAction | 12 | Control — AVM1 ActionScript bytecode |
PlaceObject2 | 26 | Control — place/move a character on the display list |
DefineSprite | 39 | Definition — a movie clip with its own tag stream |
FileAttributes | 69 | Control — flags such as “uses AS3”, network access |
DoABC | 82 | Control — AVM2 (ActionScript 3) bytecode |
The display list and how frames are drawn
SWF renders through a display list: an ordered set of objects currently on the stage, each at a depth that controls stacking. A DefineShape or DefineSprite tag only adds a character to the dictionary; it draws nothing. A PlaceObject2 tag then puts a dictionary character onto the display list at a given depth, with a transformation matrix (position, scale, rotation, skew) and an optional colour transform. ShowFrame is the tag that actually paints the current display list to the screen and moves the timeline forward one frame. So a simple animation is a repeating pattern of place/move tags followed by a ShowFrame, once per frame, up to frameCount. A DefineSprite is a movie clip: it contains its own nested tag stream with its own timeline, which is how Flash builds independently animating sub-objects.
ActionScript bytecode: AVM1, AVM2 and DoABC
What makes an SWF interactive rather than a passive animation is its embedded code. Older content (ActionScript 1 and 2) compiles to bytecode carried in DoAction tags and runs on AVM1, the first ActionScript virtual machine. ActionScript 3, introduced with Flash Player 9 in 2006, compiles to a different bytecode carried in DoABC tags and runs on AVM2, a faster, more strictly typed VM. The two are separate machines: a file’s FileAttributes tag flags whether it uses AS3, and a player selects the right VM accordingly. This bytecode is the part of an SWF that can make network calls, open URLs and react to input, which is why it is central both to Flash’s capabilities and to its security history.
Opening an SWF today with Ruffle
Ruffle is an actively developed open-source Flash Player emulator written in Rust. It re-implements the SWF format and the ActionScript virtual machines from scratch, without any Adobe code, and runs inside a memory-safe sandbox. It plays AS1/AS2 content very well and handles a growing share of AS3. There are two ways to use it: a standalone desktop application for Windows, macOS and Linux that you drag an .swf onto, and a browser extension that revives SWFs embedded in web pages. Preservation projects such as the Internet Archive and Flashpoint use Ruffle to keep tens of thousands of Flash games and animations playable. Because SWF is interactive, the honest way to keep an animation as an ordinary video is to play it in Ruffle and screen-record the result; there is no reliable one-click SWF-to-MP4 converter for code-driven content, and the original .fla source cannot be recovered from an SWF (a decompiler can only extract assets and approximate the ActionScript).
Frequently asked questions
How do I open an SWF now that Flash is dead?
Use Ruffle. Install the desktop app and drag the .swf onto it, or add the browser extension to play SWFs embedded in pages. Adobe Flash Player no longer works and cannot be safely reinstalled.
How do I convert an SWF to MP4?
Because an SWF is interactive rather than a fixed sequence of frames, the reliable method is to play it in Ruffle and screen-record with a tool such as OBS Studio, then save as MP4. Frame-by-frame renderers work only for short, non-interactive animations.
Can I get the original FLA back from an SWF?
No. The .fla is the editable source; the .swf is the compiled output, and the compilation is not reversible. A decompiler such as JPEXS can pull out images, sounds and an approximation of the ActionScript, but it cannot reconstruct the original project.
What is the difference between SWF and FLV?
SWF is the interactive Flash application: vectors, code and assets on a timeline. FLV is Flash Video, a plain video stream that Flash players displayed. They are different formats; media players that “played Flash” usually meant FLV, not interactive SWF.
References
- Ruffle — open-source Flash Player emulator (official site)
- Adobe — Flash Player end-of-life information
- SWF File Format Specification, version 19 (archived)
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.