Vietnam e-Visa Passport Data Page

The Vietnam e-Visa application asks for two images: a 4 × 6 cm portrait photo and a scan of your passport data page — the printed page carrying your photo, name and the machine-readable zone. This page is about the second one, and in particular about the upload error that keeps sending people in circles.

If the portal answered your upload with “File has script tag, please try again”, there is nothing wrong with your passport or your scanner. The file is simply too large, and the fix takes about ten seconds. The tool below is set to re-save your scan as a JPG of roughly 200KB, which is the size that reliably gets through.

Click or drag image here to upload

Supports JPG, PNG, WEBP up to 25MB

What the portal asks for

For the passport data page upload, as distinct from the portrait photo:

  • Format: JPG or JPEG. The file is inspected, so renaming a PNG or a PDF does not work.
  • The full page must be visible — all four corners inside the frame, nothing cropped off.
  • The machine-readable zone, the two lines of chevrons and capitals along the bottom, must be sharp and complete.
  • Flat and square to the camera, in focus, with no glare across the printed fields.
  • In practice, keep the file small. Around 150–250KB is the safe band, for the reason set out below.

“File has script tag, please try again” — what it actually means

The portal runs a security check over every uploaded file, scanning the raw bytes for anything resembling an HTML or script tag. It is a crude defence against someone disguising a web page as an image, and on a JPEG it misfires.

A JPEG is mostly compressed pixel data, and compressed data is close to random. In a few hundred kilobytes of it, the three-byte sequence of a “<”, a “/” and a letter will turn up by pure chance — the same way a long enough string of random letters eventually spells a word. The scanner sees the pattern, concludes the file contains a tag, and refuses it.

This is why the error feels arbitrary. Your passport scan is not special and you have done nothing wrong; your file was just large enough for the coincidence to occur. A friend uploading a smaller scan of the same passport sails through.

The size is what matters

We took a real 608KB passport scan that the portal had rejected and re-encoded it at a range of sizes, counting the tag-like byte sequences in each. The pattern is consistent: the count falls with the file size, and disappears below roughly 250KB.

EncodeFile sizeTag-like sequences
1104 × 1560, quality 90589KB4
1104 × 1560, quality 70437KB1
827 × 1168, quality 80325KB1
600 × 848, quality 80199KBnone
600 × 848, quality 55124KBnone

How to fix it

  1. Load your passport scan into the tool above. It is already set to JPG at a 200KB ceiling.
  2. Check the preview — at this size the machine-readable zone and every printed field stay comfortably legible. The data page is text on a flat background, which compresses far better than a photograph.
  3. Download the result and upload that file to the e-Visa portal instead.
  4. If it is still refused, come back and re-save at a slightly different size — 180KB instead of 200KB. This is not superstition; see below.

Why re-saving again sometimes works

Because the match is a coincidence rather than a property of your image, changing the encoding at all produces entirely different compressed bytes — and a fresh roll of the dice. A file that failed at one quality setting will usually pass at another, even at a near-identical size.

So if a 200KB version is refused, a 180KB version of the same scan will almost certainly go through. You are not fixing a fault in the image; you are stepping around a flaw in their scanner.

What this error is not

Several explanations circulate on travel forums. None of them hold up:

  • It is not a virus or malware warning. Nothing is wrong with your device.
  • It is not caused by scanner-app metadata. We checked a rejected file and it carried no XMP or XML metadata of any kind.
  • It is not about your passport, your nationality or anything printed on the page.
  • It is not fixed by renaming the file. The extension is irrelevant; the bytes are scanned.
  • It is not fixed by converting to PNG. PNG is not accepted for this upload at all.

Nothing is uploaded to us

Your passport data page is among the most sensitive documents you own — it carries your passport number, date of birth and machine-readable zone. This tool runs entirely in your browser using the Canvas API. The file is never transmitted anywhere, and no copy of it reaches a server of ours, because there is no server.

You can confirm this by opening the tool with your network disconnected: it still works.

Frequently asked questions

What does “File has script tag, please try again” mean on the Vietnam e-Visa site?
The portal scans uploaded files for HTML or script tags and misidentifies a random byte sequence inside your JPEG as one. It is a false positive caused by file size, not by anything in your image. Re-saving the scan at around 200KB clears it.
How do I fix the script tag error?
Re-save your passport data page as a JPG of roughly 150–250KB and upload that instead. If it is still refused, re-save at a slightly different size — a different encode produces different bytes and usually passes.
Does the data page scan have to be a particular size in cm?
No. Unlike the 4 × 6 cm portrait photo, the data page has no fixed dimensions — it just has to show the whole page clearly. Keep its natural proportions rather than cropping or stretching it to a set shape.
Will shrinking the file make the machine-readable zone unreadable?
No. At around 600 pixels wide the MRZ and all printed fields stay sharp. A data page is high-contrast text, which survives compression far better than a photograph does.
Can I upload a PDF of my passport page?
No. The portal accepts JPG and JPEG only. If your scanner app produced a PDF, export it as a JPG first — a PDF renamed to .jpg will be rejected.

Sources & disclaimer

The specifications on this page were taken from the sources below on the dates shown:

Please verify before you submit. Government photo requirements change without notice and are not always announced — India replaced its 2 × 2 inch passport photo standard in February 2026, for instance. The information here reflects those sources as of the dates given and may since have become out of date, and requirements can also differ between individual embassies and consulates. It is provided for general guidance only, with no warranty of accuracy or completeness, and Instant Image Resizer accepts no liability for rejected applications, fees or other losses arising from its use. Always confirm the current requirements with the issuing government authority before submitting your application.

Related tools