SmartQueryTools

Parse URL Column in CSV Files Online

Parse URL columns in CSV files and extract host, path, query string, and fragment into separate columns — directly in your browser, no upload required.

How to parse URL Column in CSV files

  1. Drop your file onto the upload area. The tool picks the first text column whose name contains url, link, href or uri as the URL column.
  2. Check the URL column. Only text columns are listed.
  3. Choose which parts to extract: Host, Path, Query and Fragment. Host and Path are selected by default.
  4. Optionally type an Output column prefix. By default new columns are named after the URL column, such as landing_url_host.
  5. Click Parse URLs, check the preview, then download the file with the new columns added at the end.

Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.

Worked example

A marketing analyst has a sessions export with full landing page URLs and wants to report by site and page, and see which campaign tags were used.

Input (CSV)

session_id,landing_url,pageviews
s-8841,https://www.example.com/pricing?utm_source=newsletter&utm_campaign=spring,4
s-8842,https://blog.example.com/2026/05/launch-notes?ref=twitter,1
s-8843,https://www.example.com/signup?ref=partner-17,6
s-8844,https://shop.example.co.uk/cart?step=2,3

Settings

  • URL column: landing_url
  • Extract parts: Host, Path, Query
  • Output column prefix: (blank, uses landing_url_)

Result

session_idlanding_urlpageviewslanding_url_hostlanding_url_pathlanding_url_query
s-8841https://www.example.com/pricing?utm_source=newsletter&utm_campaign=spring4www.example.com/pricingutm_source=newsletter&utm_campaign=spring
s-8842https://blog.example.com/2026/05/launch-notes?ref=twitter1blog.example.com/2026/05/launch-notesref=twitter
s-8843https://www.example.com/signup?ref=partner-176www.example.com/signupref=partner-17
s-8844https://shop.example.co.uk/cart?step=23shop.example.co.uk/cartstep=2

The original columns are kept and one column per selected part is appended, named with the prefix plus the part. The host keeps subdomains, so www.example.com and blog.example.com stay separate. The query is returned as one string. Individual parameters such as utm_campaign are not split into their own columns, so use Split Column on & and then on = if you need them.

Working with CSV files

URLs often contain commas in query strings, for example ?ids=4,5,6. A well-formed CSV wraps such a field in double quotes, and the reader unwraps it so the URL arrives intact. If the exporting tool did not quote those fields, the row splits into extra columns on load and the URL is cut short. Run File Repair or fix the export settings if the preview shows URLs broken at a comma.

Stray spaces are another CSV problem. A URL copied from a web page may have a trailing space or a line break, and those characters stay part of the value. Trim Whitespace before parsing gives cleaner host and path values. In the downloaded CSV, the new columns are added after the last original column. An extracted query string is quoted in the output only if it contains a comma, a quote or a line break. Paths with accented characters need a UTF-8 file. A CSV saved in another encoding can garble them, so run Encoding Convert first.

Frequently Asked Questions

Why are some URLs in my CSV cut off at a comma?

The field was not quoted in the source file, so the comma was read as a column break. Re-export with quoting on, or repair the file before parsing.

My CSV has a landing URL and a referrer URL. Can I parse both?

One column is parsed per run. Download the result, drop it back in, and parse the second column. Give each run its own prefix so the new column names do not clash.

Which URL parts can the tool extract?

Host, path, query string and fragment. It does not split out the scheme, port or individual query parameters. Use Split Column or Regex Extract on the query column for single parameters such as utm_source.

How are the new columns named?

Prefix plus part name, for example landing_url_host. The default prefix is the URL column name followed by an underscore. Characters other than letters, digits and underscores in a custom prefix are replaced with underscores.

Is the original URL column changed?

No. The original column stays as it was, and the extracted parts are appended as new columns at the end.

Related Tools