Convert dbf to xml

Free online DBF to XML converter

Convert DBF tables to structured XML while checking encoding, memo files, and schema compatibility.

Convert DBF to XML online - free

Uploading…
Selected files exceed the 75 MB total limit. Please select fewer or smaller files.

Your file is processed instantly and deleted as soon as you download it.

How it works

  1. 1/3

    Upload your .dbf file

    Click to browse to select your file you want to convert or simply drag & drop your file into selected area.

  2. 2/3

    Perform .dbf to .xml conversion

    After successful file upload, click to convert when you are ready.

  3. 3/3

    Download converted .xml file

    Conversion result is ready to download.

How to convert dbf to xml file

A legacy accounting package, GIS application, or industrial device may export records as DBF while another system requires XML for exchange, integration, or archiving. Converting the table produces a structured file that other applications can parse without DBF-specific software.

What the DBF format is

DBF, also called dBASE format, stores tabular data in a file containing a header, field definitions, and records. Common field types include character, numeric, date, logical, and memo fields.

The format originated with dBASE and is also used by FoxPro, Visual FoxPro, Clipper, older database systems, and many GIS applications. A shapefile normally includes a DBF attribute table alongside its .shp and .shx files. Memo fields may require a matching .dbt or .fpt file; keep these companion files beside the DBF during conversion.

What the XML format is

XML stores hierarchical data using named elements and attributes. A converted DBF table is commonly represented by one root element, one repeated record element per row, and child elements for the original fields:

<records>
  <record>
    <ID>17</ID>
    <NAME>North Depot</NAME>
  </record>
</records>

XML supports UTF-8, namespaces, schema validation, and explicit nesting. It is suitable for APIs, document workflows, and systems that require structured interchange, but it normally produces larger files than CSV or a binary database. Compress large XML files with ZIP or gzip when transfer size matters.

There is no universal DBF-to-XML layout. The receiving application may require a particular root element, record name, namespace, field naming convention, or XML Schema, so a syntactically valid XML file may still fail an import.

How to convert DBF to XML

For a one-time conversion without installing software, use the converter on 101convert.com: select the DBF file, upload it, start the conversion, and download the generated XML. Keep any required .dbt or .fpt memo file with the DBF if the service accepts companion files. Do not upload confidential records to an online service unless its handling policy permits it.

For repeatable processing or control over the XML structure, Python and the dbfread package provide a practical desktop method:

  1. Install Python and the reader library:
python -m pip install dbfread
  1. Save the following as dbf_to_xml.py. Replace the input and output filenames and set encoding to the DBF's actual code page.
import re
from dbfread import DBF
from xml.etree.ElementTree import Element, SubElement, ElementTree

input_file = "data.dbf"
output_file = "data.xml"

def xml_name(value):
    name = re.sub(r"[^A-Za-z0-9_.-]", "_", str(value).strip())
    if not name or not re.match(r"[A-Za-z_]", name):
        name = "field_" + name
    return name

table = DBF(input_file, load=False, encoding="cp1252")
root = Element("records")

for row in table:
    record = SubElement(root, "record")
    for field, value in row.items():
        element = SubElement(record, xml_name(field))
        if value is not None:
            element.text = str(value)

ElementTree(root).write(output_file, encoding="utf-8", xml_declaration=True)
  1. Run the script from the folder containing the DBF:
python dbf_to_xml.py

The script creates one record element per row and writes an XML declaration specifying UTF-8. Python escapes reserved characters such as & and < automatically. The generated structure is a generic representation; modify the element names and nesting when the destination requires a defined schema.

Desktop database programs and GIS applications may also provide an export command such as File → Export or Table → Export. LibreOffice Calc can open many DBF files, but its XML or spreadsheet-XML output is application-specific and may not match the schema expected by an API or database importer.

Quality and compatibility checks

  • Character encoding: DBF files often use legacy code pages such as CP1252 or CP850 rather than UTF-8. An incorrect setting can corrupt accented or non-Latin text. Check the DBF metadata and inspect representative records after conversion.
  • Dates and numbers: DBF dates, decimals, and floating-point values may be serialized differently by different tools. Set an explicit date format, decimal separator, precision, and timezone if the destination specifies them.
  • Nulls and blanks: A missing DBF value can become an empty XML element, an omitted element, or a tool-specific text value. Confirm how the target distinguishes null, empty, zero, and false.
  • Field names: Traditional DBF field names are often limited to ten characters. Spaces, punctuation, duplicate names, and names beginning with a number may need mapping to valid XML element names; retain a field-mapping record when names change.
  • Memo fields: Long text may be stored outside the DBF in a .dbt or .fpt file. Without the matching file, memo values may be missing or unreadable.
  • Validation: Check the output's XML syntax, row count, field names, encoding, dates, null values, and non-ASCII text before importing it. Validate against the recipient's XSD when one is provided.

DBF vs XML: format comparison

How the DBF and XML formats compare on the properties that matter most for this conversion.

Comparison of the DBF and XML file formats
Property .DBF dBASE Database File .XML Extensible Markup Language
Plain-text readable No Yes
Data types Typed Typed
Nested structures No Yes
Formulas No No
Multiple tables or sheets No —
Typical file size Small Small
Open standard Partly open Yes
Best used for Data exchange Data exchange
Introduced 1983 1998
Developer Ashton-Tate / dBASE, Inc. (format origin) W3C
MIME type application/x-dbf application/xml

Frequently asked questions

Is the DBF to XML converter free?

Yes, converting DBF to XML on 101convert.com is completely free. No registration, email address or installation is required. If you need a higher file size limit or want to convert more files at once, see our plans.

How large can my DBF file be?

You can upload DBF files up to 50 MB and convert up to 20 files at once in a single batch.

What happens to my uploaded files?

Files are processed automatically and deleted from our servers within a few minutes after conversion. We never view or share your files.

Do I need to install any software to convert DBF to XML?

No. The DBF to XML conversion runs entirely online in your browser and works on Windows, Mac, Linux, Android and iPhone.

Did the conversion fail?

In most cases, the cause is an incorrect file format. Please upload a valid DBF file for this DBF to XML conversion. Occasionally, the issue may be on our side. We analyze recurring conversion failures and disable or fix the converter if we detect a defect.