SUBMIT A FILE TYPE CONTACT US SUPPORT ABOUT US

What Is an SWF File? The Adobe Flash Movie, and How to Open, Check and Fix One

An SWF file is an Adobe Flash movie that stores shapes, sound and code in one file. Three readers gave one answer on 12 of the 21 damaged copies we made of one. Jump to your question below, or work through it in order.

28 min read Updated November 2026 Checked against sources and tests

What Is an SWF File? The Flash movie file that stores shapes, sound and code

Short answer

An SWF file is an Adobe Flash movie that stores vector shapes, bitmaps, sound, video and ActionScript in one file. The name began as ShockWave Flash. An SWF file starts with the letters FWS, CWS or ZWS.

We tested 96 public SWF files with three readers, ffprobe, the swf crate and swf-parser. 71 files opened in all three. We then damaged one CWS file in 21 ways, and the three readers gave one answer on 12 copies.

To open one, see the open steps. To check one, see the check steps. If your SWF file will not play, begin with the causes.

An SWF file is an Adobe Flash movie. It stores vector shapes, bitmaps, sound, video and ActionScript code in one compact file. The name began as ShockWave Flash, and Adobe stopped supporting Flash Player on December 31, 2020.

Picture an old school project on a shared drive, a game named maze.swf. You open it and nothing happens. Picture a second file with the same ending that starts in a second. The ending is the same, and only the first bytes show what the file is.

Wikipedia says SWF is a vector graphics format. Its main building block is the path, and shapes and text are made of paths. The format began as simple animation. Audio came in Flash 3 and video in Flash 6.

The format began as FutureSplash Animator in May 1996. Macromedia bought its maker, FutureWave, in December 1996 and named the product Macromedia Flash 1.0. Adobe bought Macromedia in 2005, per Wikipedia.

Adobe ended support for Flash Player on December 31, 2020. It pushed an update that blocked Flash content on January 12, 2021, per Wikipedia. Adobe's end of life page says the player gets no more security patches, so Adobe advises you to uninstall it.

So an SWF file today is a file that most browsers no longer play. People still keep SWF files from old games, banner ads, lessons and demos. Free tools like Ruffle exist to play them. We played no file, so this page studies the bytes.

Adobe published the format as a PDF. Its license barred software that plays SWF files until May 1, 2008. Adobe dropped that limit then, per Wikipedia. The last update to the spec came in January 2013 and covers version 19. We read the header part of that spec.

Where our SWF files come from

We read 96 unique files from the public test folders of the Ruffle project on GitHub. 56 came from its swf folder. 40 were drawn at random from 4,893 files in its tests folder, and we left out 54 files in the folders named movieclip_invalid. A SHA-256 check found no duplicates.

They are test files and not everyday SWF files. They are 43 to 19,454 bytes long, the median is 527 bytes and the total is 131,867 bytes. 56 are FWS, 37 are CWS and 3 are ZWS. Versions range from 1 to 43.

So this page studies how readers treat the SWF layout, and not a sample of games from the web. Many files are made to test one tag or one bug. We played none of them, so we make no claim about what Flash Player or Ruffle shows on screen.

SWF file facts at a glance

Quick facts about SWF files
Property Value
Meaning ShockWave Flash at first, later read as Small Web Format. Adobe never settled the name, per Wikipedia.
Ending .swf. The authoring file behind it ends in .fla, per Wikipedia.
Maker FutureWave, then Macromedia, then Adobe, per Wikipedia.
Media type application/x-shockwave-flash and application/vnd.adobe.flash.movie, per Wikipedia.
Layout A header of 8 bytes, then a frame size, a frame rate, a frame count and a list of tags, per the Adobe spec.
Kinds FWS, CWS and ZWS. CWS needs version 6 and ZWS needs version 13, per the spec. 56, 37 and 3 of our 96 files.
First bytes FWS, CWS or ZWS, then a version byte. Our example reads 46 57 53 0c.
Status Adobe ended Flash Player support on December 31, 2020.
Our tests 96 files, 21 damaged copies, 3 readers, a check script of 19 lines and a repair script of 12 lines.

Wrong page? An FLV file is Flash Video, and an MP4 file is a video container. See how SWF files differ from FLV and MP4 files.

Which Kind of SWF File Do You Have? Three kinds, and the first three letters name the kind

Three signatures name the kind of SWF file: FWS, CWS and ZWS. Our 96 files include 56, 37 and 3. The Adobe spec ties compression to the version, so zlib needs version 6 and LZMA needs version 13.

Read the first three bytes and then byte 3 for the version. Follow the figure. We tested all three kinds with three readers. The figure shows how many files of every kind every reader opened.

Decision chart with three kinds of SWF file read from the first three bytes, FWS uncompressed with 56 of our 96 test files, CWS zlib with 37 and ZWS LZMA with 3, with the number of files that ffprobe, the swf crate and swf-parser opened for every kind.
Figure 1. Three kinds of SWF file, read from the first three bytes of our 96 test files.

The three kinds in detail

Three kinds of SWF files and how three readers handled them
Kind Files and results
FWS, uncompressed 56 files. Nothing is compressed. All three readers opened all 56. Versions range from 1 to 43.
CWS, zlib 37 files. Everything from byte 8 on is zlib data, per the spec. The swf crate and swf-parser opened 37, and ffprobe opened 15. ffprobe refused all 22 files with version 21 or higher.
ZWS, LZMA 3 files. Everything from byte 8 on is LZMA data, per the spec. The swf crate opened 1, and the other two readers opened 0. The 2 files the swf crate refused are test files with a bad length field.

Start with the first bytes

Open the file in a hex viewer, or use xxd -l 32 example.swf on Linux or Mac. Our file starts with 46 57 53, the letters FWS. Then comes 0c, which is the version 12. Four bytes that give the length 599 follow.

The first bytes and the kind of two SWF files
xxd -l 32 example.swf
00000000: 4657 530c 5702 0000 7800 055f 0000 0fa0  FWS.W...x.._....
00000010: 0000 1801 0044 1108 0000 0043 02ff ffff  .....D.....C....
file -b example.swf
Macromedia Flash data, version 12
file -b example-cws.swf
Macromedia Flash data (compressed), version 12

The file command read the bytes and not the ending. It named the file Macromedia Flash data and printed the version. For the CWS file it added the word compressed. We used it on these two examples only, so we make no claim about its answers on the other files.

The version is a number and not a letter, so 0c means version 12. The Adobe spec covers version 19. 45 of our 96 files have a higher version, and all three readers opened every FWS file among them.

Letters first FWS, CWS or ZWS at byte 0 means an SWF file.
Version second Byte 3 is a number. CWS starts at version 6 and ZWS at version 13 in all our files.
The ending last All 96 files end in .swf, so the ending cannot name the kind.
The spec lags The spec we read covers version 19, and 45 of our files are newer.

Not sure your file is an SWF file at all? Check it with our script.

What Is Inside an SWF File? A header, a frame box and a list of tags

An SWF file starts with a header of 8 bytes, then a frame size, a frame rate, a frame count and a list of tags. Our example is 599 bytes long, and its header, rate and count fit in the first 21 bytes.

We looked inside one SWF file because its layout explains every result later on this page. Our example.swf is the Ruffle test file DefineBitsLossless2. It stores one 8 by 8 pixel bitmap, and its start shows the header.

The start of one SWF file
xxd -l 32 example.swf
00000000: 4657 530c 5702 0000 7800 055f 0000 0fa0  FWS.W...x.._....
00000010: 0000 1801 0044 1108 0000 0043 02ff ffff  .....D.....C....

The SWF spec lists the fields in order. The signature takes 3 bytes, the version 1 byte and the length 4 bytes. Then comes the frame size as a box of bits, the frame rate in 8.8 fixed point and a 2 byte frame count.

Diagram of one SWF file of 599 bytes in five parts: the signature and version, the length field, the frame size and rate, the tags and the End tag, with three rules about the signature, the length field and the compressed body.
Figure 2. One SWF file from our tests, DefineBitsLossless2.swf. The parts are not drawn to scale.

The parts, one by one

The box in our example has 15 bit fields. They read 0 to 11,000 by 0 to 8,000 twips, which is 550 by 400 pixels at 20 twips to the pixel. The rate bytes read 00 18, which is 24 frames per second. The count is 1.

The tags start at byte 21. Every tag has a 2 byte header, and a long tag has a 6 byte header. We walked all 10 tags with a short script, and their sizes add up to the last byte of the file. The End tag is last, and both parsers list the other nine.

What every part stores

Parts of SWF files and what we saw
Part What it stores
Signature FWS, CWS or ZWS. Copy A5 writes cws in lowercase, and all three readers refused it. Copy B1 adds 16 bytes in front, and all three refused that too.
Version One byte. Copy A7 sets 0, and the swf crate refused it while the other two read the file. Copy A9 sets 255, and ffprobe refused it while the other two read it.
Length field Four bytes. Copies A1 to A4 set it to 0, too big, too small and 4294967295. All three readers gave the original answer on all four.
Frame size and rate A box in twips, a rate and a count. Our example reads 550 by 400 pixels, 24 frames per second and 1 frame.
Tags A list that ends with the End tag. Copy C2 cuts a CWS file in half, and both parsers refused it. ffprobe printed a different answer.
Compressed body In a CWS file, bytes 8 on are zlib data. Copy C4 flips one bit, and both parsers refused it. ffprobe read it as the original.
The tail Copy C6 adds 100 bytes after the zlib data and C7 adds 4,096. All three readers read both as the original.

What the spec says about the length field

The spec text says the length field gives the size of the entire file. In a compressed file it gives the size after decompression. 94 of the 94 files we could decompress follow that rule, and the 2 files that fail are test files made with a bad length.

The 3 ZWS files add bytes that we measured and did not find in the part of the spec we read. Bytes 8 to 11 contain a number equal to the file size minus 17, which is 6,391 in the 6,408 byte file. Five bytes of LZMA settings follow it.

The map is small. Our script checks the signature, the version rule, the length field and the zlib data. It does not read the tags, so it cannot judge them. Copy A9 shows the limit, because the script printed OK and ffprobe refused the file.

What Did We Find in 96 Test SWF Files? Three readers, and one stopped at version 20

We tested 96 public SWF files with three readers. 71 files opened in all three, 23 opened in some and 2 opened in none. ffprobe opened 71 files, the swf crate opened 94 and swf-parser opened 93.

We counted a file as opened when a reader read it without an error. ffprobe printed the format. The swf crate and swf-parser parsed every tag. We used ffprobe 6.1.1, the swf crate 0.2.2 from the Ruffle project and swf-parser 0.14.1 on Linux.

Bar chart of 96 public test SWF files by size, from 43 bytes to 19,454, next to the number of files that three readers opened, a grid of results by kind of file, and four measured facts.
Figure 3. 96 files, three readers and four measured facts.
96 public test files
71 opened in all three readers
23 opened in some readers
2 opened in none

What the numbers show

Findings from 96 test SWF files
Finding What we measured
Uncompressed files are easy All 56 FWS files opened in all three readers, with versions from 1 to 43.
ffprobe stops at version 20 on CWS files ffprobe opened all 15 CWS files with versions 6 to 17 and refused all 22 with versions 32 to 43. We then changed only the version byte of one CWS file from 1 to 50. ffprobe accepted 1 to 20 and refused 21 to 50.
LZMA is the weak spot Only the swf crate read an LZMA file, and only 1 of 3. The swf-parser error says LZMA support is not implemented yet.
The two parsers agree On the 93 files that both parsed, they counted the same number of tags every time.
ffmpeg pulls media and draws nothing ffmpeg made an MP4 file from 6 files, a GIF from 3 and a WAV from 4. Every one is a test file for a bitmap or a sound.

What this study cannot show you

These are test files from one project, and many are made to break one tag or one rule. The 2 files that all three readers refused are test files with a bad length, so a refusal there is the right answer.

We opened no file in Flash Player or in the Ruffle player. Opening a file in a parser means the bytes are well formed. It does not mean the movie plays the way its maker meant.

What Happens When an SWF File Is Damaged? 21 broken copies, and the three readers agreed on 12

We damaged one CWS file in 21 ways. The three readers gave one answer on 12 copies and split on 9. Our script flagged or warned on 20 copies, and 7 of those 20 copies read as the original in all three readers.

Our base file is example-cws.swf, 427 bytes, made by compressing the Ruffle test file DefineBitsLossless2 with zlib. We changed one thing at a time and saved 21 copies. Same means a reader gave the answer it gave on the original file.

Grid of 21 damaged copies of one CWS file against ffprobe, the swf crate, swf-parser, our check script and a repair script. The three readers gave one answer on 12 copies, our script flagged or warned on 20, and the repair script restored 3 copies.
Figure 4. 21 damaged copies, three readers, our script and a repair script.

For the two parsers, same means the file opened with 9 tags. For ffprobe, same means it printed the same format line. Differs means a reader opened the copy and gave another answer. Refused means a reader stopped with an error.

What the grid shows

Results for 21 damaged copies of one CWS file
Group of copies What happened
A wrong length field Copies A1 to A4 set it to 0, too big, too small and 4294967295. All three readers gave the original answer on all four.
A wrong signature Copy A5 writes cws in lowercase and A6 writes FWS on a zlib body. B1 adds 16 bytes in front and B2 adds a UTF-8 byte order mark. All three readers refused all four.
A wrong version Copy A7 sets 0, and only the swf crate refused it. Copy A9 sets 255, and only ffprobe refused it. Copy A8 sets 5, and all three read it.
A text mode transfer Copy B3 changes LF to CRLF and B4 clears the high bit. ffprobe read both as the original, and both parsers refused both.
A cut file Copy C1 cuts the last byte. The swf crate read it as the original, swf-parser refused it and ffprobe printed another answer. C2 and C3 stopped both parsers.
A damaged body Copies C4, C5 and C8 flip a bit, zero 16 bytes and change the first body byte. ffprobe read all three as the original, and both parsers refused all three.
Extra bytes at the end Copy C6 adds 100 junk bytes and C7 adds 4,096 zero bytes. All three readers read both as the original.

The pattern is clear. ffprobe said yes to 5 copies that both parsers refused: B3, B4, C4, C5 and C8. The swf-parser error on C4 and C5 was incorrect data check, which is the zlib checksum. A reader that stops at the header cannot see that.

Our script and the repair script

Our check script flagged or warned on 20 copies. 7 of them, A1 to A4, A8, C6 and C7, read as the original in all three readers. The script printed OK for one copy, A9. ffprobe refused that copy. See the script.

The repair script restored 3 copies, A5, B1 and B2, by finding the signature again and rewriting the length. It also made A1 to A4, C6 and C7 match the original byte for byte, so 9 copies are byte for byte. It could not restore a cut file, a changed body or a text mode copy.

The same 21 changes on an uncompressed file

We made the same 21 changes to the uncompressed original, with the signature changes adapted. The three readers gave one answer on 15 copies and split on 6. ffprobe read 14 copies as the original, the swf crate read 11 and swf-parser read 12.

Copies C4 and C5 flip a bit and zero 16 bytes inside an uncompressed body, and all three readers read both as the original. A zlib body ends with a checksum. We know of no checksum in an uncompressed body, and no reader refused C4 or C5.

What Does Our Expert Say About SWF Files? A note from Neeraj Singh on comparing readers

We asked our expert what the grid means for someone who has a Flash file and has to decide if it is damaged. He read the 21 copies and the three reader columns.

Neeraj Singh

Expert insight

Never trust one reader with a Flash file. In our tests ffprobe said yes to five copies with a broken body while two other readers said no. Try a second tool before you decide that a file is damaged or sound.

Neeraj Singh Manager, Tech Support & Operations 19+ years fixing Windows and system errors

That advice fits the grid. The two parsers gave the same answer on 19 of the 21 copies. ffprobe gave another answer than both of them on 8 copies. A second tool that reads the entire file is the cheapest test.

How Do You Open an SWF File? Ruffle, three readers and what we tested

Most browsers no longer play SWF files. To play one, use an emulator like Ruffle, which its site says works on desktop and on the web. To read one without playing it, we tested ffprobe, the swf crate and swf-parser.

Adobe's notice says major browser vendors have also disabled Flash Player. So the old route of clicking a link and watching a movie in the browser is gone. The options below are the tools we know of, and the tag says what we did with every tool.

Your options

Ruffle Not tested An open-source Flash emulator written in Rust, per its site. It lists AVM1 (ActionScript 1 and 2) at 99% for language and 82% for API, and AVM2 (ActionScript 3) at 90% and 82%. We played no file in it.
Adobe Flash Player Not tested Adobe ended support on December 31, 2020 and advises you to uninstall it. We did not use it.
ffprobe Tested Reads the header of an SWF file and prints the format. It does not play the file. It opened 71 of our 96 files.
swf crate Tested A Rust parser from the Ruffle project. It opened 94 of 96 files and counted the same tags as swf-parser.
swf-parser Tested A parser for Node from the Open Flash project. It opened 93 of 96 files and cannot read LZMA.
Media players Not tested FileInfo lists GOM Player, Media Player Classic and SWF File Player among programs that open SWF files. We tested none of them.

Read the file without playing it

A parser reads the bytes and plays nothing. That makes it a safe first step with a file you do not know. ffprobe prints the format name when it accepts the file.

ffprobe on our example file
ffprobe -v error -show_entries format=format_name -of default=nw=1 example.swf
format_name=swf

ffprobe has a limit. In our tests it refused every CWS file with version 21 or higher, and a refusal there says nothing about the file. Ask a second reader before you call the file damaged.

Read the letters FWS, CWS or ZWS at byte 0 means the file is an SWF file. See the kinds.
Use two readers ffprobe refused 22 CWS files that both parsers opened. See the study.
Keep a copy Work on a copy of the file, and keep the original unchanged.
Know the limit A parser that opens a file does not prove the movie plays.

Is the file an MP4 or FLV file? The MP4 file page and the FLV file page cover those formats.

How Do You Check an SWF File? Six steps and a script of 19 lines

Check an SWF file in six steps. Copy it, read the first bytes, apply the version rule, compare the length field, test the zlib data and use a second reader. Our script of 19 lines does the middle four.

  1. Copy the file and work on the copy. Keep the original.
  2. Read the first bytes with xxd -l 16 file.swf. The first three letters must be FWS, CWS or ZWS.
  3. Read byte 3, the version. CWS needs version 6 or higher and ZWS needs version 13 or higher, per this spec.
  4. Compare the length field with the file. In an FWS file it equals the file size. In a CWS file it equals the size after decompression.
  5. Test the zlib data of a CWS file. Python does it in a few lines, and our script does it for you.
  6. Use a second reader. We used ffprobe, the swf crate and swf-parser. The three gave one answer on 12 of 21 damaged copies.

The check script

The script reads one file at a time. It prints OK when the header and the body agree. It prints WARN when it sees extra bytes or cannot check the body, and FLAG when something is wrong. It uses only the Python standard library.

swf_peek.py, 19 lines
import struct,sys,os,zlib
def peek(path):
    b=open(path,'rb').read(); n=len(b)
    if b[:3] not in (b'FWS',b'CWS',b'ZWS') or n<8: return 'FLAG','no FWS, CWS or ZWS signature at byte 0'
    ver=b[3]; fl=struct.unpack('<I',b[4:8])[0]
    if ver==0: return 'FLAG','version byte is zero'
    if b[:1]==b'C' and ver<6: return 'FLAG','CWS needs version 6 or higher'
    if b[:1]==b'Z': return 'WARN','LZMA body not checked'
    if b[:1]==b'F':
        if fl>n: return 'FLAG','file is %d bytes shorter than the header says'%(fl-n)
        return ('WARN','%d extra bytes after the end'%(n-fl)) if fl<n else ('OK','header and size agree')
    o=zlib.decompressobj()
    try: d=o.decompress(b[8:])
    except zlib.error as e: return 'FLAG','zlib data is damaged: '+str(e)[:40]
    if not o.eof: return 'FLAG','zlib data ends early'
    if len(d)+8!=fl: return 'FLAG','length field says %d, data is %d'%(fl,len(d)+8)
    return ('WARN','%d extra bytes after the zlib data'%len(o.unused_data)) if o.unused_data else ('OK','header and zlib data agree')
if __name__=='__main__':
    for p in sys.argv[1:]: print(os.path.basename(p),*peek(p))
What the script prints
python3 swf_peek.py example.swf example-cws.swf
example.swf OK header and size agree
example-cws.swf OK header and zlib data agree
python3 swf_peek.py A2.swf C6.swf
A2.swf FLAG length field says 1599, data is 599
C6.swf WARN 100 extra bytes after the zlib data

On our 96 files it printed OK for 93 and WARN for 3. The 3 are the ZWS files, because the script does not check LZMA data. Two of them are the test files that all three readers refused, so the script cannot see that fault.

On the 21 damaged copies it flagged or warned on 20 and printed OK for one, A9. The damage grid shows every result. A script like this finds header and zlib faults. It cannot judge the tags.

The repair script

The repair script fixes the faults in the first bytes. It looks for the signature in the first 1,024 bytes and drops what comes before it. It writes the letters in capitals and rewrites the length field. For a CWS file it also drops bytes after the zlib data.

swf_fix.py, 12 lines
import re,struct,sys,zlib
def fix(b):
    m=re.search(rb'[FCZ]WS(?=[\x01-\x7f])',b[:1024],re.I)
    if not m: return b
    b=b[m.start():]; s=b[:3].upper()
    if s==b'ZWS': return s+b[3:]
    if s==b'FWS': return s+b[3:4]+struct.pack('<I',len(b))+b[8:]
    o=zlib.decompressobj()
    try: d=o.decompress(b[8:])
    except zlib.error: return s+b[3:]
    return s+b[3:4]+struct.pack('<I',len(d)+8)+b[8:len(b)-len(o.unused_data)]
if __name__=='__main__': open(sys.argv[2],'wb').write(fix(open(sys.argv[1],'rb').read()))

It restored 3 of our 21 copies, A5, B1 and B2. It made 9 copies match the original byte for byte. It cannot restore a cut file or a damaged body, and it does not touch the version byte. Work on a copy and keep the original.

Is an SWF File Safe to Open? Looking is safe, and playing needs care

Looking at the bytes of an SWF file starts nothing. The risk comes from playing it, because an SWF file can contain ActionScript code. Adobe no longer patches Flash Player, so do not install it to play an old file.

Wikipedia notes that SWF supports ActionScript, which adds interactivity and powers browser games. Code is the reason to take care. The same page says Flash Player suffered from many security holes, and that is part of why Adobe ended it.

Adobe's page on the end of Flash Player says Flash Player gets no more security patches. Adobe advises you to uninstall it. That advice covers the old player, and it gives you a reason to prefer a newer tool for an old file.

Do not install an old Flash Player It gets no security patches, per Adobe. Use an emulator or a parser instead.
A parser reads and plays nothing ffprobe, the swf crate and swf-parser read bytes. We used all three on 96 files and played none.
Work on a copy Keep the original file unchanged. Our scripts write a new file and leave the source alone.
Know where the file came from We scanned no file for malware, so we make no claim about the files in our set or about yours.

A file named .swf that does not start with FWS, CWS or ZWS is not an SWF file, and the first look at the letters shows it. For a PDF with Flash inside, read the PDF file page.

Is the file a program? An EXE file is a Windows program. Read the EXE file page for how to check one.

Why Will Your SWF File Not Play? Eight causes, and what to do about every one

Eight causes stop an SWF file from playing, and the file is the cause in only some of them. The first cause is the program, because browsers dropped Flash. The rest are the reader, the letters, the version, the body and the transfer.

Work down the list in order. The first two causes cost nothing to test. The last six come from our 21 damaged copies, so every fix below names a copy and a result.

1. Your browser or player dropped Flash Adobe ended Flash Player support on December 31, 2020. Major browsers disabled it, per Adobe. Use a tool made for old Flash files. See the open options.
2. Your reader is the limit ffprobe refused all 22 CWS files with version 21 or higher, and swf-parser refused all 3 LZMA files. Try a second reader before you blame the file.
3. The letters are wrong or bytes are in front Copies A5, A6, B1 and B2 changed the signature or added bytes in front, and all three readers refused all four. Our repair script restored A5, B1 and B2. It cannot restore A6.
4. A text mode transfer changed the bytes Copies B3 and B4 change LF to CRLF and clear the high bit. Both parsers refused both, and ffprobe read both. Our script cannot undo this, so download the file again in binary mode.
5. The file is cut short Copies C1, C2 and C3 cut a byte, half and all but 8 bytes. swf-parser refused all three. Get a full copy, because cut data does not come back.
6. The zlib body is damaged Copies C4, C5 and C8 flip a bit, zero 16 bytes and change the first body byte. Both parsers refused all three, and ffprobe read all three as the original. Use a second reader and get a new copy.
7. The version byte is wrong Copy A7 sets 0 and only the swf crate refused it. Copy A9 sets 255 and only ffprobe refused it. Copy A8 sets 5 and all three read it. Compare two readers before you edit the byte.
8. The length field is wrong Copies A1 to A4 set it wrong in four ways, and all three readers gave the original answer on all four. Our script flags it and rewrites it, and the file matched the original byte for byte.

What to try first

Read the letters Use xxd -l 16 file.swf. Without FWS, CWS or ZWS the file is not an SWF file.
Use the check script See the script. It flags the length field and a broken zlib body.
Try a second reader The two parsers gave one answer on 19 of 21 copies. ffprobe gave another answer than both on 8.
Get a new copy A cut file or a damaged body does not come back. Download it again in binary mode.

How Do You Convert an SWF File to MP4 or GIF? What ffmpeg did with 96 files

ffmpeg cannot draw an SWF movie. In our tests it made an MP4 file from 6 of 96 files, a GIF from 3 and a WAV from 4. Every one is a test file for a bitmap or a sound. We tested no tool that plays the movie and records it.

Many people search for SWF to MP4 and SWF to GIF. The answer from our lab is narrow. ffmpeg reads the media inside an SWF file. It does not play the vector shapes or the ActionScript code.

What ffmpeg did with 96 files

Results of ffmpeg 6.1.1 on 96 SWF files
Output What happened
MP4 ffmpeg wrote an MP4 file from 6 files. 64 files had no media stream. 14 were refused as input and 11 stopped with a read error. 1 failed because libx264 needs an even size, and the picture is 5 by 5.
GIF ffmpeg wrote a GIF from 3 files, all with a bitmap inside. Our example gave a GIF of 847 bytes.
WAV ffmpeg wrote a WAV from 4 files, all with a sound inside. The sound in DefineSound.swf lasts 0.000227 seconds.
The three commands that worked on our files
ffmpeg -i example.swf -c:v libx264 -pix_fmt yuv420p example.mp4
ffmpeg -i example.swf example.gif
ffmpeg -i DefineSound.swf sound.wav

Our example is the 8 by 8 pixel bitmap. The MP4 file is 1,535 bytes with one H.264 frame, and the SWF file is 599 bytes. The MP4 file is larger than the SWF file here, and one case does not set a rule.

What we did not test

For a game or an animation, a tool must play the movie and record the frames. We did not test the Ruffle exporter, JPEXS or a web converter. the FileInfo page lists Xilisoft Video Converter Ultimate and Eltima Flash Decompiler Trillix among programs for the format. We tested neither.

Check what you get. Compare the length and the frame count of the new file with what you expect. ffmpeg wrote a sound of 0.000227 seconds from our sound test file, so a file that converts is not always a useful file.

Need the target format? Read the MP4 format page or the GIF format page.

How Does an SWF File Differ From FLV, MP4 and FLA Files? One movie, three neighbors, measured

An SWF file is a Flash movie with shapes and code. An FLV file is Flash video, an MP4 file is a video container and an FLA file is the editable source behind an SWF file. We measured our MP4 at 1,535 bytes against 599 for the SWF file.

The table lists the neighbors of an SWF file. Sizes depend on the tool and the contents, so they show one case and not a rule. Our example is a tiny test file.

SWF, FLV, MP4 and FLA compared
Type What separates it
SWF A Flash movie. It can store shapes, bitmaps, sound, video and ActionScript, per Wikipedia. Our example was 599 bytes.
FLV A Flash video file. The FLV page on this site covers it. Video support came to SWF in Flash 6, per Wikipedia.
MP4 A video container. Our example became an MP4 file of 1,535 bytes with one H.264 frame.
FLA The editable source behind an SWF file in Adobe Flash, per Wikipedia. Other Adobe tools that write SWF do not use it. We had no FLA file.

SWF or FLV

An SWF file is a full movie that can contain code. An FLV file stores video and audio. Read what an FLV file is for the video format.

SWF or MP4

An MP4 file stores encoded video frames. An SWF file stores shapes and code that a player draws. ffmpeg wrote an MP4 file from 6 test files with a bitmap or a sound, and from none of the other 90. Read how an MP4 file works.

SWF or FLA

Wikipedia calls the FLA file the editable source behind SWF in Adobe Flash. Wikipedia says importing an SWF file into Flash recovers some assets and not all. Keep the FLA file if you have one.

Which one do you have

FLV files Read the Flash video guide for Flash video.
MP4 files Read the video container guide for the video container.
GIF files Read the short animation guide for a short image animation.
PDF files Read the guide to PDF files. Adobe Reader 9 and later can embed SWF, per Wikipedia.

What Is the SWF File Format Made Of? The facts we could check, and where they came from

An SWF file stores a header, a frame box and a list of tags, and CWS and ZWS files compress the part after the first 8 bytes. Facts below come from our checks of 96 files and 21 damaged copies. Sources are Wikipedia, Adobe and the three test tools.

Facts about SWF files
Part What we could check
Maker FutureWave made FutureSplash Animator in May 1996. Macromedia bought it in December 1996, and Adobe bought Macromedia in 2005, per Wikipedia.
Name ShockWave Flash at first and later Small Web Format, with the ending .swf. Media types are application/x-shockwave-flash and application/vnd.adobe.flash.movie, per Wikipedia. We did not look up the registry.
First bytes FWS, CWS or ZWS, then the version. 56 of our files say FWS, 37 say CWS and 3 say ZWS. The versions range from 1 to 43.
Layout A header of 8 bytes, then a frame size box, a frame rate, a frame count and tags, per the spec. Our example reads 550 by 400 pixels, 24 frames per second and 1 frame.
Length field Four bytes, and in a compressed file the size after decompression, per the spec. 94 of the 94 files we could decompress follow that rule.
Compression CWS uses zlib from version 6, and ZWS uses LZMA from version 13, per the spec. Everything after the first 8 bytes is compressed.
Tags A list of tags that ends with the End tag. Our example has 10, and the parsers list 9 plus End.
Versions The spec covers version 19, and Flash Player 14 uses version 25, per Wikipedia. 45 of our 96 files have a version above 19.
Spec The license limit ended on May 1, 2008. The last spec update came in January 2013 and covers version 19, per Wikipedia.
Our tests 96 files, 21 damaged copies, 3 readers, a check script of 19 lines and a repair script of 12 lines. ffprobe 6.1.1, swf crate 0.2.2 and swf-parser 0.14.1 on Linux.

About the values we list

Facts about the layout come from our own reading of one example file and 96 test files, and from the pages we name. The version 19 spec is the source for the header, and Wikipedia is the source for the history.

We read most of the spec and not all of it. The part we read does not describe the 4 bytes and the 5 bytes that follow the length field in a ZWS file. We report what we measured there, and we make no claim about the rest of the LZMA layout.

What we left out

We played no file in Flash Player or in Ruffle. We used no web converter, no decompiler and no malware scanner. Our readers and scripts worked on Linux, and other programs can accept or refuse files that they treat differently.

All 96 files come from one project, and many are made to test readers. Our damaged copies come from one small file and change one thing at a time. We did not read the rules for ActionScript or the tag list in full.

Sources checked

For the format, see the SWF file format specification, the Wikipedia article on SWF and the end of life notice from Adobe. For the programs, see FileInfo and the Ruffle project.

For the tools, see ffprobe, the swf crate and swf-parser. The test files come from the Ruffle project. Every count on this page came from files and scripts in our research folder.

Frequently Asked Questions About SWF Files

What is an SWF file?

An SWF file is an Adobe Flash movie. It stores vector shapes, bitmaps, sound, video and ActionScript code in one file. The name began as ShockWave Flash. Adobe ended Flash Player support on December 31, 2020, per Wikipedia.

How do I open an SWF file?

Use an emulator like Ruffle, which its site says works on desktop and on the web. We tested three readers and played no file. ffprobe opened 71 of our 96 files, the swf crate opened 94 and swf-parser opened 93.

Why will my SWF file not play?

Your browser or player dropped Flash, or the file is damaged. Browsers disabled Flash after 2020, per Adobe. ffprobe refused 22 files that both parsers read. Try a second tool before you give up.

What does SWF stand for?

It stood for ShockWave Flash at first. It was later read as Small Web Format. Adobe has never settled the name, per Wikipedia.

Is an SWF file safe to open?

Looking at the bytes starts nothing. Playing the file is the risk, because an SWF file can contain ActionScript. Adobe no longer patches Flash Player, so do not install it. We scanned no file for malware.

How do I convert an SWF file to MP4?

ffmpeg wrote an MP4 file from 6 of our 96 files, and all 6 contained a bitmap or a sound. It drew no shapes or code. Use a tool that plays the movie and records it. We tested none.

How do I convert an SWF file to GIF?

ffmpeg wrote a GIF from 3 of our 96 files, all with a bitmap inside. For a game or an animation you need a tool that plays the movie. Our tests did not cover one.

How can I check if an SWF file is damaged?

Read the first three letters, apply the version rule, compare the length field and test the zlib data. Our script flagged or warned on 20 of 21 damaged copies, and 7 of those copies read as the original in all three readers. Use two readers.

Can a damaged SWF file be repaired?

Some header damage can be repaired. Our script restored 3 copies by fixing the letters and the length field, and it made 9 copies match the original byte for byte. Cut files and damaged bodies did not come back.

What is the difference between FWS, CWS and ZWS?

FWS is uncompressed, CWS uses zlib and ZWS uses LZMA, per the Adobe spec. CWS needs version 6 and ZWS needs version 13. Our 96 files have 56, 37 and 3 of them. ffprobe refused CWS files above version 20.

Do all readers agree on a damaged SWF file?

No. Our three readers gave one answer on 12 of 21 damaged copies and split on 9. ffprobe read 5 copies with a broken body that both parsers refused. Compare two readers.

Can browsers still play SWF files?

Not through Flash Player. Adobe blocked Flash content on January 12, 2021. Major browsers disabled the player, per Adobe and Wikipedia. Emulators like Ruffle exist for old files. We did not play a file in one.

Still Stuck With an SWF File? Where to go next, depending on what went wrong

Your SWF file will not play

Read the first bytes and use the check script. The cause list names what to try in order.

You do not know the kind

The kinds table names the kind, and the neighbors name the formats that look alike.

Is it an FLV file? The guide to FLV files covers Flash video.

Is it an MP4 file? The guide to MP4 files covers the video container.

Do you need a GIF? The guide to GIF files covers the short image animation.

Is it a program? The guide to EXE files covers the Windows program file.

Is it a file type you do not know? Browse the file extension resource library, or send it on the submit a file type page.

Do you need the format facts? Read the format part for the layout, the versions and the sources of SWF files.