Photoshop PSD & TIFF to JPG Script – Free
If you work with Photoshop regularly, you probably know how time-consuming it can be to save multiple designs as JPG files. Opening each PSD or TIFF file, choosing Save As, selecting the format, and repeating the same steps for every design takes time, especially when you have a large folder of files.
To make this task easier, I’m sharing a Photoshop batch conversion script that automatically converts multiple PSD, PSB, TIF, and TIFF files into JPG images. You only need to select the folder containing your designs and then choose where you want the converted images to be saved.
Whether you have 20 designs or hundreds of files, the script can process them in one run without requiring you to save each image manually.
What Does This Photoshop Script Do?
This script automates the repetitive task of exporting Photoshop designs as JPG images. It opens each supported file, creates a copy for conversion, flattens that copy, and saves the result as a high-quality JPG in your selected output folder.
Here are the main features:
Batch Conversion: Process all supported files directly inside one selected folder.
PSD and TIFF Support: Convert PSD, PSB, TIF, and TIFF files into JPG format.
Automatic Saving: Let Photoshop open, convert, and save each file automatically.
High JPEG Quality: Uses Photoshop's JPEG quality setting of 12.
Separate Output Folder: Choose where all converted images should be saved.
Original Files Stay Unchanged: The script converts a duplicate instead of flattening the original design.
Filename Preservation: Keeps the original filename where possible.
Overwrite Protection: If a JPG with the same name already exists, the script creates a new filename rather than silently replacing it.
Download the Photoshop PSD & TIFF to JPG Script
Copy the complete script code from the section below and save it as a JSX file. You can then run it directly from Adobe Photoshop.
Script filename: Batch_PSD_TIFF_to_JPG.jsx
"
#target photoshop
app.bringToFront();
(function () {
var sourceFolder = Folder.selectDialog("Select the folder containing PSD/TIFF files");
if (!sourceFolder) return;
var outputFolder = Folder.selectDialog("Select the folder where JPG files should be saved");
if (!outputFolder) return;
var files = sourceFolder.getFiles(function (f) {
return f instanceof File && /\.(psd|psb|tif|tiff)$/i.test(f.name);
});
if (!files.length) {
alert("No PSD, PSB, TIF, or TIFF files were found in the selected source folder.");
return;
}
var oldDialogs = app.displayDialogs;
var oldUnits = app.preferences.rulerUnits;
app.displayDialogs = DialogModes.NO;
app.preferences.rulerUnits = Units.PIXELS;
var succeeded = 0;
var failed = [];
var jpgOptions = new JPEGSaveOptions();
jpgOptions.quality = 12;
jpgOptions.embedColorProfile = true;
jpgOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgOptions.matte = MatteType.WHITE;
try {
for (var i = 0; i < files.length; i++) {
var doc = null;
try {
doc = app.open(files[i]);
// JPG cannot retain layers or transparency. Duplicate and flatten the copy,
// leaving the original PSD/TIFF untouched.
var copy = doc.duplicate();
copy.flatten();
var baseName = files[i].name.replace(/\.[^\.]+$/, "");
var outFile = new File(outputFolder.fsName + "/" + baseName + ".jpg");
// Avoid silently overwriting an existing JPG.
if (outFile.exists) {
var counter = 1;
do {
outFile = new File(outputFolder.fsName + "/" + baseName + "_" + counter + ".jpg");
counter++;
} while (outFile.exists);
}
copy.saveAs(outFile, jpgOptions, true, Extension.LOWERCASE);
copy.close(SaveOptions.DONOTSAVECHANGES);
copy = null;
doc.close(SaveOptions.DONOTSAVECHANGES);
doc = null;
succeeded++;
} catch (e) {
failed.push(files[i].name + " — " + e.message);
try { if (doc) doc.close(SaveOptions.DONOTSAVECHANGES); } catch (_) {}
try { if (app.documents.length > 0 && app.activeDocument.name !== "") {
// Any duplicate left active after an error is closed without saving.
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
} } catch (_) {}
}
}
} finally {
app.displayDialogs = oldDialogs;
app.preferences.rulerUnits = oldUnits;
}
var message = "Batch conversion finished.\n\nSuccessful: " + succeeded +
"\nFailed: " + failed.length + "\nOutput folder:\n" + outputFolder.fsName;
if (failed.length) {
message += "\n\nFailed files:\n" + failed.join("\n");
}
alert(message);
})();
"
Keep this section reserved for the full Photoshop script code.
How to Use the Script in Photoshop
You don't need to open and save your designs one by one. Follow these steps to run the script.
Step 1: Save the script
Copy the complete JavaScript code provided above into a plain-text editor and save the file as Batch_PSD_TIFF_to_JPG.jsx. Make sure the filename ends with .jsx, not .jsx.txt.
Step 2: Open Photoshop
Launch Adobe Photoshop on your computer. You don't need to open your designs manually before running the script.
Step 3: Run the JSX file
Go to File → Scripts → Browse, select the saved JSX file, and run it.
Step 4: Select your source folder
A folder selection window will appear. Choose the folder containing the PSD, PSB, TIF, and TIFF files you want to convert.
Step 5: Select the output folder
Choose a separate folder where Photoshop should save the converted JPG images. Keeping the output separate makes it easier to organize your files.
Step 6: Let Photoshop finish
Photoshop will process the supported files one by one. When the process finishes, a report will show how many files were converted successfully and whether any files failed.
Example of Batch Conversion
Suppose your source folder contains these files:
Wedding Card.psdFestival Banner.psdBusiness Poster.tifSocial Media Design.tiff
After conversion, the output folder will contain:
Wedding Card.jpgFestival Banner.jpgBusiness Poster.jpgSocial Media Design.jpg
The script processes all supported files directly inside the selected folder. It does not automatically scan files inside nested subfolders.
Important Things to Know Before Converting
JPG is a flattened image format, so it cannot retain Photoshop layers, editable text, or transparency. The script flattens a duplicate of each document before exporting, leaving the original PSD or TIFF file unchanged.
Transparent areas are given a white matte in the JPG output. If your design uses transparency, check the exported image to make sure it looks the way you expect.
The script uses JPEG quality level 12, which is Photoshop's highest standard JPEG quality setting. However, JPG is still a lossy format, so it is not a pixel-for-pixel replacement for your original file.
If your work depends on exact color reproduction, check a few exported images before processing an entire project. The source document's color profile and the way the output is viewed can affect the appearance of colors.
Frequently Asked Questions
Can I convert 20, 100, or more files at once?
Yes. The script processes all supported files found directly inside the selected source folder. The actual processing time depends on file size, image dimensions, available memory, and your computer's performance.
Will the original PSD and TIFF files be changed?
The script is designed to leave the originals unchanged. It creates a duplicate for flattening and JPG export, then closes the documents without saving changes to the original files.
Can I choose where the JPG images are saved?
Yes. The script asks you to select the source folder first and the destination folder second.
Does it support TIFF files as well as PSD files?
Yes. It supports .tif and .tiff files, along with .psd and .psb files.
What happens if a JPG with the same filename already exists?
The script avoids silently overwriting an existing JPG. It creates a numbered filename instead.
Final Thoughts
If you frequently export Photoshop designs for websites, clients, social media, or other projects, batch conversion can save you a lot of repetitive work. Instead of saving every PSD or TIFF file separately, you can select your folders and let Photoshop handle the process.
Keep your original working files safely stored, check a sample of the exported JPG images, and use the script whenever you need to convert multiple designs at once.
