CustomsEZ
CustomsEZ Logo
hs code converterdubai trade flat fileexcel to flat filecustoms file convertermirsal upload filedubai customs declarationmirsal 2 flat filedubai trade portalcustoms tariff code uae

HS Code Converter for Dubai Trade: How to Convert Your Product List

15 min read

Introduction: Why You Need an HS Code Converter for Dubai Trade

If you import or export goods through Dubai, you already know that every shipment declaration submitted through the **Dubai Trade portal** requires a properly formatted flat file. At the heart of that file is the **Harmonized System (HS) code** — the internationally standardized numerical classification that tells customs authorities exactly what you are shipping.

The problem most traders face is straightforward: your product data lives in an **Excel spreadsheet**, but Dubai Trade and **Mirsal 2** require a very specific **pipe-delimited flat file** with precise field ordering, fixed-length codes, and strict validation rules.

An **HS code converter** bridges that gap. It takes your existing product list and transforms it into a file that Mirsal 2 will accept on the first upload. No manual reformatting, no rejected declarations, no wasted time.

In this guide, we walk through the entire process: what the flat file format looks like, how to prepare your Excel data, how to run the conversion, and how to troubleshoot the most common errors traders encounter.

What Is a Dubai Trade Flat File?

A **Dubai Trade flat file** is the standardized data file that the Mirsal 2 customs system accepts for import and export declarations. Unlike a spreadsheet with rows and columns, a flat file is a plain-text document where each field is separated by a **pipe delimiter ( | )**.

**Key format specifications:**

• **Delimiter:** The pipe character ( | ) separates every field • **Header row:** The first line contains declaration-level metadata — declarant code, declaration type (IM4, IM5, EX1, etc.), customs office code, and date fields • **Item rows:** Each subsequent line represents one line item with **40+ fields** in a fixed order • **HS code field:** Expects a **10-digit HS code** conforming to the UAE customs tariff schedule • **Encoding:** Files must be saved in **UTF-8** or **Windows-1252** encoding • **Line endings:** CRLF recommended for consistency

**Critical fields in each item row (in order):**

• Field 1: Item sequence number (starting at 1) • Field 2: HS code (10 digits, no dots or spaces) • Field 3: Product description (free text, max 256 characters) • Field 4: Country of origin (2-letter ISO code) • Field 5: Customs Procedure Code (CPC) • Field 6: Quantity (numeric, up to 3 decimal places) • Field 7: Unit of measurement (KGM, LTR, PCS, MTR, etc.) • Field 8: Gross weight in kilograms • Field 9: Net weight in kilograms • Field 10: CIF value in AED • Field 11: Invoice currency code • Field 12: Invoice value in original currency

Even a single misplaced field or an HS code with the wrong number of digits will cause Mirsal 2 to reject the entire file.

Step-by-Step: Converting Your Excel Product List

Converting your product data from Excel to a Dubai Trade flat file involves three phases: **preparation, conversion, and validation**.

**Phase 1: Prepare Your Excel File**

• **One row per product line item.** Do not merge cells or leave blank rows • **HS codes in a dedicated column formatted as text** — if Excel treats your HS code as a number, it will strip leading zeros • **Consistent units.** Use UOM codes that Dubai Customs expects: **KGM** for kilograms, **PCS** for pieces, **LTR** for litres • **Values in the right currency.** Include columns for invoice currency and CIF value • **Country of origin.** Use **2-letter ISO country codes** (CN, US, DE)

**Phase 2: Upload and Convert**

• Navigate to the converter tool and select your Excel file (.xlsx or .xls) • **Map your columns** to the required flat file fields • Select your **declaration type** (e.g., IM4 for import, EX1 for export) and enter your declarant code • Click **Convert** to generate the flat file

**Phase 3: Download and Validate**

• Download the generated **.txt flat file** and open it in a text editor • Verify that pipe delimiters are in place and each line has the correct number of fields • Spot-check HS codes for leading zeros and correct digit count • Upload the file to the **Dubai Trade portal** for your declaration submission

Convert your Excel to flat file now

Convert Your File — Free

Common Conversion Errors and How to Fix Them

Even with a good converter, your source data may have issues. Here are the most frequent problems:

**1. HS Codes with Wrong Digit Count** • **Symptom:** Mirsal 2 rejects with "Invalid tariff code" errors • **Cause:** Your Excel has 6-digit or 8-digit codes instead of 10-digit UAE codes • **Fix:** Use the converter's built-in HS code lookup to extend short codes to the full 10-digit UAE tariff code

**2. Leading Zeros Stripped from HS Codes** • **Symptom:** Codes for items like fish (Chapter 03) or dairy (Chapter 04) appear as 8 or 9 digits • **Cause:** Excel formatted the HS code column as a number instead of text • **Fix:** Format the column as Text in Excel. Enable "Pad HS codes to 10 digits" in the converter

**3. Wrong Column Mapping** • **Symptom:** Product descriptions appear in the weight field • **Cause:** Auto-detect misidentified your column headers • **Fix:** Manually verify column mapping before generating the flat file

**4. Encoding Problems with Arabic Text** • **Symptom:** Arabic characters appear as garbled symbols • **Cause:** Non-Unicode encoding • **Fix:** Save your Excel file as .xlsx (UTF-8 internally). Select UTF-8 as output encoding

**5. Duplicate Item Numbers** • **Symptom:** Mirsal 2 reports "duplicate sequence number" • **Fix:** Let the converter auto-generate sequential item numbers starting from 1

Batch Conversion for Large Shipments

If you handle **high-volume trade operations** — consolidators, freight forwarders, or free zone warehouses — converting files one at a time is not practical.

**Multiple Declarations from a Single Spreadsheet**

• Structure your master Excel file with a **declaration reference column** that groups items by shipment • The converter can **split your spreadsheet** by reference, generating one flat file per unique reference • A single Excel file with 500 items across 10 shipments produces 10 separate flat files

**Handling Multiple Suppliers or Invoices**

• When a single declaration includes goods from multiple suppliers, make sure your spreadsheet includes **invoice number** and **currency** columns at the item level • The converter preserves per-item invoice details in the flat file

**Performance Considerations**

• The converter processes files of up to **10,000 line items** without issues • For very large operations, break your master file into batches of 2,000-3,000 items each

**Archiving and Audit Trail**

• Keep your original Excel files and generated flat files together in a structured folder system • Dubai Customs may request source documentation during audits

Frequently Asked Questions

**What file formats does the converter accept?** The converter accepts **.xlsx** (Excel 2007+), **.xls** (legacy Excel), and **.csv** files. For best results, use .xlsx — it preserves text formatting for HS codes with leading zeros.

**Can I use 6-digit international HS codes?** Dubai Trade and Mirsal 2 require the **full 10-digit UAE customs tariff code**. If you only have 6-digit or 8-digit codes, use the converter's built-in HS code search to find the correct UAE extension.

**Does the converter handle re-export declarations?** Yes. Re-export declarations require additional fields including the **original import declaration reference number**. Select the re-export declaration type and the converter will prompt for these fields.

**What if Mirsal 2 still rejects my file?** Download the **error report** from Dubai Trade — it specifies which line and field caused the rejection. Common post-conversion issues include HS codes not in the current tariff schedule, CIF values that do not match invoice totals, or mismatched declarant codes.

Start Converting Your Product Lists Today

Getting your Excel product data into the correct format for Dubai Trade should not be the bottleneck in your customs workflow. Every hour spent manually reformatting spreadsheets is an hour taken away from your actual business.

With the right **HS code converter**, you can go from a raw Excel product list to a validated, Mirsal 2-ready flat file in minutes — not hours.

**Ready to streamline your customs declarations?** Try the HS Code Converter now — upload your Excel file, map your columns, and download your Dubai Trade flat file in under five minutes. No registration required, no software to install.

Whether you are filing your first import declaration or processing hundreds of shipments per month, accurate and fast file conversion is the foundation of a smooth customs clearance process.

Ready to Convert Your HS Codes?

Convert Your Excel to Dubai Trade Format — Free. Join 1,300+ customs professionals.

Free for single files. Team plans from 1,500 AED/year. View pricing