Import CSV file into SQLite

11 Mar 2026

  1. Download SQLite precompiled binaries and add them to your $PATH : https://sqlite.org/download.html
  2. Open SQLite and import the CSV file:
    # Note: First row is used for column names, if you don't have header - create table before import
    sqlite3 <db-name>
    .mode csv
    .import <path-your-csv-file> <db-table-name> --skip <n>
       
    # Alternative with explicit separator
    sqlite3 <db-name> 
    .separator ,
    .import <path-your-csv-file> <db-table-name> --skip 1 --csv
    
  3. That’s it, now you can execute any SQL query on the imported data.
    sqlite3 <db-name>
    .tables
    .schema <table-name>
    .mode column
    SELECT * FROM <table-name> LIMIT 3;
    
  4. Alternatively you can use DB Browser for SQLite, it has GUI : https://sqlitebrowser.org/