The short answer to "can you convert JPEG to RAW?" is: technically yes, practically no — not in the way most photographers mean it. A converted file will have a .raw extension and contain uncompressed pixel data, but it will never recover the information JPEG discarded when it was first created. This guide explains exactly what happens when you convert JPEG to RAW, what you actually get, when it is useful, and what your real alternatives are.
What RAW format actually is
Camera RAW is not a single file format — it is a category of formats that store the unprocessed, uncompressed sensor data captured by a camera's image sensor before any in-camera processing occurs. Formats like Canon's CR2/CR3, Nikon's NEF, Sony's ARW, Fujifilm's RAF, and Olympus's ORF are all RAW formats. Adobe's DNG is a vendor-neutral RAW standard. What they share is that they record raw light measurements at 12 or 14 bits per channel — far more data than JPEG's 8 bits per channel.
When a camera shoots in RAW mode, the sensor data is saved directly to the card with minimal in-camera processing. When a camera shoots JPEG, it processes the RAW sensor data, applies white balance, sharpening, noise reduction, and colour corrections, then compresses the result using lossy JPEG compression and discards the original sensor data. That discarded data is gone permanently — it exists nowhere on the card or in the file.
What RAW data contains that JPEG does not
- Extended dynamic range — RAW files capture 12–14 bits per channel, giving 4,096–16,384 tonal values per channel. JPEG captures 8 bits: 256 values per channel.
- Non-destructive white balance — RAW records the raw sensor data; white balance is applied in post without degrading the image. JPEG bakes the white balance into the pixels permanently.
- Recoverable highlights and shadows — RAW can recover 2–4 stops of over- or under-exposure in post-processing. JPEG clipping is permanent.
- No generation loss — editing and re-saving RAW (exported as TIFF or DNG) does not degrade the image. Each JPEG save re-compresses and introduces additional artefacts.
- Full colour data — camera sensors record one colour channel per pixel (Bayer pattern); RAW contains the raw Bayer data. JPEG has already had demosaicing applied.
Note
Can you really convert JPEG to RAW?
Yes — in a technical, file-format sense. You can take the pixel data stored in a JPEG file and write it to a file in a raw binary format. The output will have a `.raw` extension (or `.dng`, if you use Adobe DNG Converter) and will be recognised as a RAW file by software that reads raw pixel buffers. The conversion is real and the file is genuinely different from the JPEG.
What you cannot do is restore the data that JPEG discarded. The conversion captures the 8-bit per channel pixel values that survived JPEG compression — nothing more. You are repackaging existing data into a different container. The bit depth stays at 8 bits; the dynamic range stays compressed; the JPEG artefacts, the lost highlight detail, and the baked-in colour processing remain exactly as they were. The resulting RAW file is simply a larger file with the same image quality.
You cannot add information that was never captured. Converting JPEG to RAW changes the container, not the content.
JPEG to RAW as a lossless re-encoding
The most accurate description of the conversion is lossless re-encoding: the pixel values from the JPEG are copied exactly into the RAW format without further compression or quality loss. No additional data is lost in the conversion itself — but the data that was lost when the camera originally saved the JPEG cannot be recovered. Think of it like transcribing a photocopy of a document: the transcription is accurate, but it still only contains what was on the photocopy, not what was on the original.
Warning
When converting JPEG to RAW pixel data is actually useful
The conversion is genuinely useful in several technical contexts that have nothing to do with photography workflow. These use cases require a raw binary pixel buffer as input — the format produced by the JPG to RAW converter on Quasar Tools — not camera RAW sensor data.
Image processing and computer vision pipelines
Computer vision algorithms, image processing libraries (OpenCV, PIL/Pillow, libpng), and machine learning pipelines often work directly with raw pixel buffers rather than encoded image files. Converting JPEG to a raw binary format strips the file header and encoding overhead, giving direct access to the RGB or RGBA byte sequence. This is faster to read and process than parsing a JPEG stream.
Game engine texture pipelines
Some game engines and graphics frameworks accept raw pixel data as a texture source. Converting JPEG to RAW with a specific bit depth (typically 24-bit RGB or 32-bit RGBA) produces a texture buffer that can be loaded directly into GPU memory without an intermediary decode step. This is common in embedded systems, custom game engines, and graphics demos.
Firmware and embedded display systems
Microcontrollers and embedded displays — LCD panels, e-paper screens, LED matrices — typically cannot decode JPEG on-device due to computational constraints. Converting images to raw pixel arrays in advance (often at a reduced resolution like 64×64) allows the display to load and render the image without decoding. The JPG to RAW converter supports custom bit depths (8, 16, 24, or 32-bit) to match the target display's colour format.
Academic and research workflows
Research involving pixel-level image analysis sometimes requires the raw numerical pixel values without any format encoding. Converting to a raw binary format makes the pixel array directly readable by NumPy, MATLAB, or any language with binary file I/O — no image library required. The file is simply a flat array of integers in row-major order.
JPG to RAW Converter
Convert any JPG or JPEG image to a raw pixel binary file at 8, 16, 24, or 32-bit depth — entirely in your browser with no upload required.
JPEG vs RAW: what you actually get from each
The choice between JPEG and RAW should be made at capture time, not in post-processing. Understanding the concrete differences helps set expectations about what is and is not recoverable after the fact.
| Attribute | Camera RAW | JPEG |
|---|---|---|
| Bit depth | 12–14 bits/channel | 8 bits/channel |
| Tonal values | 4,096–16,384 per channel | 256 per channel |
| Compression | ✗ None (lossless) | ✓ Lossy (8:1 to 20:1 typical) |
| File size | 15–50 MB typical | 3–8 MB typical |
| White balance | Adjustable non-destructively | Baked in permanently |
| Dynamic range | Full sensor range | Compressed to 8-bit range |
| Highlight recovery | 2–4 stops recoverable | ✗ Clipped data unrecoverable |
| Editing headroom | High — no generation loss | Low — re-saving adds artefacts |
| Compatibility | Requires RAW processor | Universal |
The one-way nature of JPEG compression
JPEG compression is irreversible by design. The algorithm applies a Discrete Cosine Transform (DCT) to 8×8 pixel blocks, quantises the frequency coefficients (discarding high-frequency detail based on a quality setting), and Huffman-encodes the result. The discarded coefficients exist only in the compression step — they are not stored anywhere in the JPEG file and cannot be recovered by any means. This is fundamentally different from a lossless format like PNG or TIFF, where the original pixel values are always recoverable from the file.
Tip
Better alternatives to converting JPEG to RAW
If your goal is higher image quality or more editing flexibility from a JPEG, the answer is not to convert it to RAW — it is to work with the JPEG correctly, or to capture in RAW from the start. Here are the alternatives worth considering depending on your actual use case.
For editing: use TIFF or PSD as the working format
When editing a JPEG in Lightroom, Photoshop, or any professional editor, export to TIFF or PSD rather than saving back as JPEG. This preserves the pixel values through editing rounds without re-compression artefacts. TIFF is 8-bit by default (matching the JPEG source) but lossless — each save does not degrade the image. You are not recovering lost data, but you are preventing further loss from repeated JPEG re-compression.
For colour accuracy: convert to PNG
PNG uses lossless compression and preserves every pixel value exactly. Converting a JPEG to PNG via a tool like PNG Converter (in reverse) or any image editor produces a file where further edits do not introduce artefacts. PNG is significantly larger than JPEG but smaller than TIFF or RAW. For web workflows, converting once to PNG and editing from there avoids the compounding quality loss of multiple JPEG saves.
For smaller files: compress the JPEG properly first
If the goal is reducing file size rather than improving quality, compressing the JPEG is more effective than converting to RAW and back. The JPEG Compressor on Quasar Tools reduces JPEG file size with an adjustable quality slider and shows the exact KB saved and compression ratio before you commit to the output. A quality setting of 80–85 is typically indistinguishable from a quality-100 image at roughly half the file size.
For comparing format options
If you are deciding which format to use for a specific image — JPEG, PNG, WebP, AVIF, or GIF — the Image Format Comparison tool shows your image compressed in all five formats simultaneously with size and quality compared side by side. This is the fastest way to make a data-driven format decision for any specific image.
Image Format Comparison
Upload one image and see its compressed size across JPEG, PNG, WebP, AVIF, and GIF simultaneously — with a quality slider to find the optimal format and setting.
How to convert JPG to RAW (the pixel buffer format)
If you need raw pixel data — for a computer vision project, a game engine texture, an embedded display, or any other technical workflow that requires direct byte access to pixel values — here is the exact process using the Quasar Tools converter.
- Open the JPG to RAW Converter — navigate to /tools/image/converters/jpg-to-raw. No account or signup is required.
- Upload your JPG or JPEG file — drag and drop or click to browse. The image is loaded entirely in your browser; it is never sent to a server.
- Select the bit depth — choose 8-bit (grayscale), 16-bit (high-precision grayscale), 24-bit (RGB colour), or 32-bit (RGBA with alpha channel) based on your target application.
- Convert and download — the tool processes the image and produces a raw binary file containing the pixel data in the selected format, ready to download.
- Use in your pipeline — load the raw binary file into your application using direct file I/O: each pixel is stored sequentially in row-major order with the number of bytes per pixel matching the selected bit depth.
Reading raw pixel data in common languages
A 24-bit RGB raw file at 800×600 pixels is exactly `800 × 600 × 3 = 1,440,000` bytes. The first three bytes are the R, G, B values of the top-left pixel; the next three bytes are the second pixel in the top row; and so on. In Python, `numpy.fromfile('image.raw', dtype=numpy.uint8).reshape(600, 800, 3)` loads this directly into a usable array without any image library. In C, read the file into a `unsigned char` buffer of the correct size and index pixels as `buffer[(y * width + x) * 3 + channel]`.
Note
Key takeaways
- Converting JPEG to RAW repackages the existing pixel data into a raw binary format — it does not recover the dynamic range, bit depth, or detail that JPEG compression discarded at capture time.
- JPEG stores 8 bits per channel (256 tonal values); camera RAW stores 12–14 bits per channel (4,096–16,384 values) — this gap cannot be bridged after the JPEG is saved.
- The conversion is genuinely useful for technical workflows: computer vision pipelines, game engine textures, embedded displays, and any application that requires direct pixel buffer access.
- The JPG to RAW Converter on Quasar Tools produces a raw binary pixel file at 8, 16, 24, or 32-bit depth — entirely in your browser with no upload.
- For editing workflows, convert JPEG to TIFF or PNG instead — these lossless formats prevent re-compression artefacts without changing the underlying pixel quality.
- If you need actual camera RAW capabilities, the only solution is to shoot in RAW mode — post-capture conversion from JPEG cannot recreate what the camera's sensor originally captured.
- Use the Image Format Comparison tool to find the optimal format and compression setting for any specific image before committing to a conversion.