Skip to main content
SwissKnife supports a wide range of file formats across multiple categories. This page provides a comprehensive overview of supported file types and conversion capabilities.

File Type Categories

SwissKnife automatically detects file types based on their extensions and categorizes them into five main groups:

Documents

Supported document formats for reading and conversion:
  • PDF (.pdf) - Portable Document Format
  • Microsoft Word (.docx, .doc) - Word documents
  • Plain Text (.txt) - Text files
  • Markdown (.md) - Markdown documents
  • EPUB (.epub) - E-book format
  • PowerPoint (.pptx) - Presentation files
  • Excel (.xlsx) - Spreadsheet files

Images

Supported image formats:
  • JPEG (.jpg, .jpeg) - Compressed image format
  • PNG (.png) - Portable Network Graphics
  • WebP (.webp) - Modern web image format
  • GIF (.gif) - Graphics Interchange Format
  • BMP (.bmp) - Bitmap image
  • TIFF (.tiff) - Tagged Image File Format

Audio

Supported audio formats:
  • MP3 (.mp3) - MPEG Audio Layer 3
  • WAV (.wav) - Waveform Audio File Format
  • FLAC (.flac) - Free Lossless Audio Codec
  • AAC (.aac) - Advanced Audio Coding
  • OGG (.ogg) - Ogg Vorbis
  • M4A (.m4a) - MPEG-4 Audio

Video

Supported video formats:
  • MP4 (.mp4) - MPEG-4 Video
  • AVI (.avi) - Audio Video Interleave
  • MKV (.mkv) - Matroska Video
  • MOV (.mov) - QuickTime Movie
  • WMV (.wmv) - Windows Media Video
  • FLV (.flv) - Flash Video
  • WebM (.webm) - Web Media format

Archives

Supported archive formats:
  • ZIP (.zip) - ZIP archive
  • TAR (.tar) - Tape Archive
  • GZIP (.gz) - GNU Zip
  • BZIP2 (.bz2) - Bzip2 compressed
  • 7-Zip (.7z) - 7-Zip archive
  • RAR (.rar) - Roshal Archive

Conversion Compatibility

Document Conversions

Documents can be converted to a wide variety of formats: Supported output formats:
  • .pdf, .docx, .doc, .txt, .md, .epub, .pptx, .html, .tex, .xml, .bib, .json, .rst, .rtf, .odt, .org, .ipynb, .fb2, .icml, .opml, .texi, .textile, .typ, .muse, .hs, .1, .adoc, .dj, .ms
# Convert Word to PDF
python solution.py convert document.docx output.pdf

# Convert Markdown to PowerPoint
python solution.py convert report.md presentation.pptx

# Convert text to Word
python solution.py convert thesis.txt formatted.docx

# Convert Excel to PDF
python solution.py convert data.xlsx summary.pdf

# Convert Org mode to LaTeX
python solution.py convert notes.org academic.tex

Image Conversions

Images can be converted between formats and to PDF: Supported output formats:
  • .jpg, .jpeg, .png, .webp, .gif, .bmp, .tiff, .pdf
# Convert PNG to JPEG
python solution.py convert photo.png compressed.jpg

# Convert BMP to PDF
python solution.py convert diagram.bmp vector.pdf

# Convert WebP to TIFF
python solution.py convert screenshot.webp archive.tiff

# Convert GIF to PNG
python solution.py convert animation.gif static.png

Audio Conversions

Audio files can be converted between all supported audio formats: Supported output formats:
  • .mp3, .wav, .flac, .aac, .ogg, .m4a
# Convert MP3 to FLAC (lossless)
python solution.py convert song.mp3 lossless.flac

# Convert WAV to AAC (compressed)
python solution.py convert podcast.wav compressed.aac

# Convert M4A to OGG
python solution.py convert recording.m4a universal.ogg

Video Conversions

Videos can be converted between formats and to GIF: Supported output formats:
  • .mp4, .avi, .mkv, .mov, .wmv, .flv, .webm, .gif
# Convert MP4 to WebM
python solution.py convert movie.mp4 optimized.webm

# Convert AVI to MOV
python solution.py convert presentation.avi portable.mov

# Convert MKV to GIF
python solution.py convert tutorial.mkv social.gif
When converting videos to GIF, SwissKnife automatically optimizes the output with:
  • 10 fps frame rate for smaller file size
  • 480px width scaling (maintains aspect ratio)
  • Optimized color palette generation
  • Bayer dithering for better quality

Archive Conversions

Archives can be converted between all supported archive formats: Supported output formats:
  • .zip, .tar, .gz, .bz2, .7z, .rar
# Convert ZIP to TAR.GZ
python solution.py convert backup.zip extracted.tar.gz

# Convert RAR to 7-Zip
python solution.py convert files.rar compressed.7z

# Convert with password protection
python solution.py convert protected.zip backup.7z --password mypassword
Password protection is supported when converting archives, but note that some formats like .tar, .tar.gz, .tar.bz2, .tar.xz, .gz, .bz2, and .xz do not support password protection natively.

Conversion Limitations

PDF Source Files

PDF to other formats is not supported due to technical limitations. PDF files can only serve as output targets, not as source files for conversion to other document formats.
You can:
  • ✅ Convert documents, images to PDF
  • ❌ Convert PDF to Word, Text, Markdown, etc.

Format-Specific Notes

Document Conversions:
  • LaTeX installation required for PDF output from documents
  • Some advanced formatting may be lost during conversion
  • Text files (.txt) are processed as Markdown format
Image Conversions:
  • JPEG conversion automatically converts images to RGB mode
  • PDF output from images uses 100 DPI resolution
  • Optimization is applied automatically (85% quality for JPEG)
Audio Conversions:
  • MP3, M4A, AAC use 192kbps bitrate by default
  • WAV and FLAC maintain lossless quality
  • Video tracks are stripped (audio-only output)
Video Conversions:
  • Default encoding uses H.264 (libx264) for most formats
  • WebM uses VP9 codec with Opus audio
  • All videos are scaled to ensure even dimensions
  • Fast encoding presets used for quicker conversion
Archive Conversions:
  • Archives are extracted to temporary directory then re-compressed
  • Password protection preserved when converting between compatible formats
  • Requires external tools for .7z and .rar formats

Batch Conversion

You can convert entire directories of files at once:
# Convert all DOCX files to PDF
python solution.py batch-convert ./docs ./output .docx .pdf

# Convert all PNG images to JPEG
python solution.py batch-convert ./images ./compressed .png .jpg
The batch conversion will:
  • Process all files with the specified input extension
  • Create output directory if it doesn’t exist
  • Preserve original files automatically
  • Report success and failure counts

Build docs developers (and LLMs) love