<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Pankaj Chavan</title>
    <description>The latest articles on DEV Community by Pankaj Chavan (@pankaj_gdg_1395bc486f0909).</description>
    <link>https://dev.to/pankaj_gdg_1395bc486f0909</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4022832%2F3d348490-d1e3-46a3-95a8-9b1d9d84585f.png</url>
      <title>DEV Community: Pankaj Chavan</title>
      <link>https://dev.to/pankaj_gdg_1395bc486f0909</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pankaj_gdg_1395bc486f0909"/>
    <language>en</language>
    <item>
      <title>What actually happens when you "convert" a file</title>
      <dc:creator>Pankaj Chavan</dc:creator>
      <pubDate>Thu, 09 Jul 2026 13:23:00 +0000</pubDate>
      <link>https://dev.to/pankaj_gdg_1395bc486f0909/what-actually-happens-when-you-convert-a-file-40cj</link>
      <guid>https://dev.to/pankaj_gdg_1395bc486f0909/what-actually-happens-when-you-convert-a-file-40cj</guid>
      <description>&lt;h1&gt;
  
  
  I Thought File Conversion Was Just "Save As." I Was Wrong.
&lt;/h1&gt;

&lt;p&gt;Last week someone asked me a question that sounded almost too simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What actually happens when you convert a file?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You'd think the answer would be something like &lt;em&gt;"the extension changes."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It doesn't.&lt;/p&gt;

&lt;p&gt;Whether you're converting PNG → JPG, DOCX → PDF, MP4 → GIF, or CSV → JSON, your computer isn't renaming a file. It's reading one format, understanding its structure, then rebuilding everything according to another format's rules.&lt;/p&gt;

&lt;p&gt;That sounds obvious—until you realize how much can change during the process.&lt;/p&gt;




&lt;h2&gt;
  
  
  A file isn't just bytes
&lt;/h2&gt;

&lt;p&gt;Every file format has its own "language."&lt;/p&gt;

&lt;p&gt;A JPEG stores compressed image data.&lt;/p&gt;

&lt;p&gt;A PNG stores pixels differently and can include transparency.&lt;/p&gt;

&lt;p&gt;A PDF describes pages.&lt;/p&gt;

&lt;p&gt;A DOCX stores editable text, styles, comments, metadata, and much more.&lt;/p&gt;

&lt;p&gt;When you convert between formats, the converter has to translate between two completely different systems.&lt;/p&gt;

&lt;p&gt;Think of it like translating a novel from English to Japanese.&lt;/p&gt;

&lt;p&gt;You don't copy letters.&lt;/p&gt;

&lt;p&gt;You interpret meaning.&lt;/p&gt;

&lt;p&gt;Some things translate perfectly.&lt;/p&gt;

&lt;p&gt;Some don't.&lt;/p&gt;




&lt;h2&gt;
  
  
  What actually happens during conversion?
&lt;/h2&gt;

&lt;p&gt;Most converters follow roughly the same pipeline.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Read the source file
&lt;/h3&gt;

&lt;p&gt;The converter identifies the real format—not just the filename.&lt;/p&gt;

&lt;p&gt;Changing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;photo.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;photo.jpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;doesn't magically create a JPEG.&lt;/p&gt;

&lt;p&gt;The converter has to understand the PNG structure first.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Decode the contents
&lt;/h3&gt;

&lt;p&gt;The file is unpacked into something software can work with.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Images become pixels&lt;/li&gt;
&lt;li&gt;Audio becomes waveforms&lt;/li&gt;
&lt;li&gt;Videos become frames + audio streams&lt;/li&gt;
&lt;li&gt;Documents become text, images, tables, and formatting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At this stage, the converter works with the actual content rather than the original file format.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Transform the data
&lt;/h3&gt;

&lt;p&gt;Now the converter adjusts everything to fit the destination format.&lt;/p&gt;

&lt;p&gt;Sometimes that's easy.&lt;/p&gt;

&lt;p&gt;Sometimes it's impossible.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PNG transparency disappears in JPG.&lt;/li&gt;
&lt;li&gt;Word comments vanish in PDF.&lt;/li&gt;
&lt;li&gt;Animated GIFs lose quality.&lt;/li&gt;
&lt;li&gt;Excel formulas may become plain values in CSV.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every destination format has limits.&lt;/p&gt;

&lt;p&gt;The converter can't invent features that don't exist.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. Encode the new file
&lt;/h3&gt;

&lt;p&gt;Finally everything is written into the new format.&lt;/p&gt;

&lt;p&gt;This is where compression usually happens.&lt;/p&gt;

&lt;p&gt;Some formats are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;lossless&lt;/li&gt;
&lt;li&gt;lossy&lt;/li&gt;
&lt;li&gt;optimized for editing&lt;/li&gt;
&lt;li&gt;optimized for viewing&lt;/li&gt;
&lt;li&gt;optimized for streaming&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each makes different trade-offs.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why some conversions lose quality
&lt;/h2&gt;

&lt;p&gt;This is probably the biggest misconception.&lt;/p&gt;

&lt;p&gt;People often expect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PNG → JPG → PNG
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to produce the original image.&lt;/p&gt;

&lt;p&gt;It won't.&lt;/p&gt;

&lt;p&gt;JPEG throws away image information during compression.&lt;/p&gt;

&lt;p&gt;Once those details disappear, converting back to PNG can't restore them.&lt;/p&gt;

&lt;p&gt;It's like photocopying a photocopy.&lt;/p&gt;

&lt;p&gt;The new format can preserve what's left.&lt;/p&gt;

&lt;p&gt;It can't recover what was discarded.&lt;/p&gt;




&lt;h2&gt;
  
  
  Lossless vs. lossy
&lt;/h2&gt;

&lt;p&gt;A useful way to think about it:&lt;/p&gt;

&lt;h3&gt;
  
  
  Lossless
&lt;/h3&gt;

&lt;p&gt;Nothing important is discarded.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PNG&lt;/li&gt;
&lt;li&gt;FLAC&lt;/li&gt;
&lt;li&gt;ZIP&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can usually reconstruct the original data exactly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lossy
&lt;/h3&gt;

&lt;p&gt;Information is intentionally removed to reduce file size.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JPEG&lt;/li&gt;
&lt;li&gt;MP3&lt;/li&gt;
&lt;li&gt;AAC&lt;/li&gt;
&lt;li&gt;H.264 video&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The file becomes much smaller, but some quality is permanently gone.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why PDF to Word is so messy
&lt;/h2&gt;

&lt;p&gt;People assume PDFs contain text documents.&lt;/p&gt;

&lt;p&gt;Many don't.&lt;/p&gt;

&lt;p&gt;A PDF might contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;scanned pages&lt;/li&gt;
&lt;li&gt;positioned letters&lt;/li&gt;
&lt;li&gt;embedded fonts&lt;/li&gt;
&lt;li&gt;images pretending to be text&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When converting back to Word, the software has to guess:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;paragraphs&lt;/li&gt;
&lt;li&gt;headings&lt;/li&gt;
&lt;li&gt;tables&lt;/li&gt;
&lt;li&gt;margins&lt;/li&gt;
&lt;li&gt;lists&lt;/li&gt;
&lt;li&gt;columns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sometimes those guesses are excellent.&lt;/p&gt;

&lt;p&gt;Sometimes everything ends up inside a giant text box.&lt;/p&gt;




&lt;h2&gt;
  
  
  Not every conversion is reversible
&lt;/h2&gt;

&lt;p&gt;Some formats simply contain more information than others.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RAW photo
        ↓
JPEG
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The JPEG is smaller because lots of camera data disappeared.&lt;/p&gt;

&lt;p&gt;Converting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;JPEG
        ↓
RAW
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;doesn't recreate the missing sensor information.&lt;/p&gt;

&lt;p&gt;The converter can only wrap the JPEG inside another format.&lt;/p&gt;

&lt;p&gt;It can't recreate details that no longer exist.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why online conversion can feel slow
&lt;/h2&gt;

&lt;p&gt;If you're using a cloud converter, there are more steps than people realize.&lt;/p&gt;

&lt;p&gt;Your file typically:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;uploads&lt;/li&gt;
&lt;li&gt;waits in a queue&lt;/li&gt;
&lt;li&gt;gets processed&lt;/li&gt;
&lt;li&gt;is saved temporarily&lt;/li&gt;
&lt;li&gt;downloads again&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For small files, the conversion itself often takes less time than the upload.&lt;/p&gt;

&lt;p&gt;Modern browsers can even perform many conversions locally using technologies like WebAssembly, avoiding the upload entirely for supported formats.&lt;/p&gt;




&lt;h2&gt;
  
  
  So why do conversions sometimes fail?
&lt;/h2&gt;

&lt;p&gt;Usually it's one of these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;corrupted file&lt;/li&gt;
&lt;li&gt;unsupported codec&lt;/li&gt;
&lt;li&gt;password-protected document&lt;/li&gt;
&lt;li&gt;unsupported format version&lt;/li&gt;
&lt;li&gt;missing fonts&lt;/li&gt;
&lt;li&gt;damaged metadata&lt;/li&gt;
&lt;li&gt;invalid file structure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The converter isn't necessarily broken.&lt;/p&gt;

&lt;p&gt;Sometimes the source file simply doesn't contain enough valid information to interpret correctly.&lt;/p&gt;




&lt;h2&gt;
  
  
  The biggest takeaway
&lt;/h2&gt;

&lt;p&gt;File conversion isn't changing an extension.&lt;/p&gt;

&lt;p&gt;It's translation.&lt;/p&gt;

&lt;p&gt;Every converter reads one language and writes another.&lt;/p&gt;

&lt;p&gt;Sometimes that translation is perfect.&lt;/p&gt;

&lt;p&gt;Sometimes information is lost.&lt;/p&gt;

&lt;p&gt;Sometimes the destination format simply can't express everything that existed in the original.&lt;/p&gt;

&lt;p&gt;Once you understand that, a lot of "weird conversion bugs" suddenly make sense.&lt;/p&gt;

&lt;p&gt;And the next time someone asks why their PNG became blurry after turning it into a JPEG three times...&lt;/p&gt;

&lt;p&gt;...you'll know exactly why.&lt;/p&gt;

&lt;p&gt;If you'd like to experiment with different file formats yourself, you can try Bluebird Tools&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>computerscience</category>
      <category>explainlikeimfive</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
