CSV to XML Converter

Updated: May 26, 2018
CSV   XML   CONVERSION  

CSV to XML Converter is used to convert CSV data or file into XML. You can choose whether to write the values as XML attributes or as text inside the record elements. The XML elements generated can also be named as per your choice.

Input: Paste CSV content below



Settings


Output: Converted XML


CSV is an old & very popular format for storing tabular data. It has been used in the desktop as well as mainframe. It is a simple & compact format that works really well for tabular data and so is still in use today.

XML is a widely used language that was once the de facto standard for data interchange between applications. Since the advent of JSON, however, it has lost the advantage to the more simple nature of JSON. Nevertheless, XML is still used by applications and SOAP based web services

First Row Is Header
If selected, first row is assumed to be the header and property names are generated using it otherwise property names are generated automatically using a number pattern: column 1, column 2, column 3, etc. In the latter case, first row is interpreted as data.
First Row is Header On
[
  {
    "name": "Robin Hood",
    "department": "Sales",
    "salary": 200
  }
]
First Row is Header Off
[
  {
    "column 1": "Name",
    "column 2": "Department",
    "column 3": "Salary"
  },
  {
    "column 1": "Robin Hood",
    "column 2": "Sales",
    "column 3": 200
  }
]
Delimiter
The delimiter in the input CSV is specified here. In most cases the default setting Auto Detect works fine. But, in really small CSV data with delimiters also occurring as literals, the auto detection logic might not choose the correct delimiter. In such a scenario, the delimiter can be manually specified. Following are the choices for delimiters:-
  • Comma
  • Tab
  • Space
  • Pipe
  • Semi-Colon
Root Element Name
This is the name of the root element of the output XML under which the record/row nodes are created.
Root Element: People
<?xml version="1.0" encoding="utf-8"?>
<People>
  <Record Name="John Doe" Age="69" />
  <Record Name="Jane Doe" Age="65" />
</People>
Root Element: Root
<?xml version="1.0" encoding="utf-8"?>
<Root>
  <Record Name="John Doe" Age="69" />
  <Record Name="Jane Doe" Age="65" />
</Root>
Record Element Name
This is the name of all the record/row elements created in the output XML.
Record Element: Person
<?xml version="1.0" encoding="utf-8"?>
<Root>
  <Person Name="John Doe" Age="69" />
  <Person Name="Jane Doe" Age="65" />
</Root>
Record Element: Record
<?xml version="1.0" encoding="utf-8"?>
<Root>
  <Record Name="John Doe" Age="69" />
  <Record Name="Jane Doe" Age="65" />
</Root>
Indent
This setting governs whether or not the output is indented. The indented output is easier for humans to comprehend. On the other hand, a non-indented output is compact & smaller in size (best for transmission).
Indentation On
<?xml version="1.0" encoding="utf-8"?>
<Root>
  <Record Name="John Doe" Age="69" />
  <Record Name="Jane Doe" Age="65" />
</Root>
Indentation Off
<?xml version="1.0" encoding="utf-8" ?><Root><Record Name="John Doe" Age="69" /><Record Name="Jane Doe" Age="65" /></Root>
Attribute Values
This setting governs how the values are written in the output XML. When turned on, the values are written as XML attributes of the record elements. When turned off, the values are written as text nodes inside the record elements.
Attribute Values On
<?xml version="1.0" encoding="utf-8"?>
<People>
  <Person Name="John Doe" Age="69" />
  <Person Name="Jane Doe" Age="65" />
</People>
Attribute Values Off
<?xml version="1.0" encoding="utf-8"?>
<People>
  <Person>
    <Name>John Doe</Name>
    <Age>69</Age>
  </Person>
  <Person>
    <Name>Jane Doe</Name>
    <Age>65</Age>
  </Person>
</People>
 
Created: Aug 25, 2017
Online Tool Designed For: Windows, OS X, Android, iOS, Linux