Location of Mozilla Firefox history

Windows
C:\Users\<username>\AppData\Roaming\Mozilla\Firefox\Profiles\<profile folder>
C:\Users\<username>\AppData\Local\Mozilla\Firefox\Profiles\<profile folder>\cache2
macOS
/Users/<username>/Library/Application Support/Firefox/Profiles/<profile folder>
/Users/<username>/Library/Caches/Firefox/Profiles/<profile folder>/cache2
Linux
/home/<username>/.mozilla/firefox/<profile folder>
/home/<username>/.cache/mozilla/firefox/<profile folder>/cache2

Up to version 31 the cache files were stored in a folder named 'Cache'. Starting with version 32 the cache files are stored in a folder named 'cache2'.

Format of Mozilla Firefox history

Bookmarks
Firefox Bookmarks are stored in the 'places.sqlite' database, within the 'moz_bookmarks' table. Associated URL information is stored within the 'moz_places' table.
Browser Settings
Firefox Browser Settings are stored in the 'prefs.js' file.
Cache
Firefox Cache is stored using a Cache Map File ('_CACHE_MAP_'), three Cache Block files ('_CACHE_00#_'), and a number of separate data files. The cache structure was changed in Firefox version 32 and named 'Cache v2'.
Cookies
Firefox Cookies are stored in the 'cookies.sqlite' database, within the 'moz_cookies' table.
Downloads
Firefox Downloads are stored in the 'places.sqlite' database, within the 'moz_annos' table. Associated URL information is stored within the 'moz_places' table. Older versions of Firefox stored Downloads in a separate 'downloads.sqlite' database, within the 'moz_downloads' table.
Favicons
Firefox Favicons are stored in the 'favicons.sqlite' database, within the 'moz_icons' table. Older versions of Firefox stored Favicons in the 'places.sqlite' database, within the 'moz_favicons' table.
Form History
Firefox Form History is stored in the 'formhistory.sqlite' database, within the 'moz_formhistory' table.
Logins
Firefox Logins are stored in the 'logins.json' file. Older versions of Firefox stored Logins in a 'signons.sqlite' database, within the 'moz_logins' table.
Searches
Firefox doesn't explicitly store Searches however they can be extracted from URLs within Website Visits, Session Data, Cache Records and Favicons.
Session Data
Firefox Session Data is stored in JSON format within the 'sessionstore.jsonlz4' file.
Thumbnails
Firefox Thumbnails are stored as individual PNG files within the 'thumbnails' folder.
Website Visits
Firefox Website Visits are stored in the 'places.sqlite' database, within the 'moz_historyvisits' table. Associated URL information is stored within the 'moz_places' table.