Accepted answer

the basic difference is that the hashhistory uses urls like:

with browserhistory you get normal urls (no hash):


1) browser’s history’s location array contains more than just the locations that have been visited within our application. allowing access to this list would leak information about a user’s browsing history that websites should not be allowed access to.

2) browser history creates location objects whose pathname is the url’s full pathname. however, you can specify a basename for a history, in which case a portion of the full pathname will be effectively ignored.

3) browser history in static file server will have one real location on our server to fetch our html from while hash history uses the hash section of the url to set and read locations.

4) hash history is reliant as it store all of the path information in the hash of a url.


i don't think the question was asking for differences in the format, but rather technical. hence sharing this answer here with a technical difference:

basically the browser don't send the url after the #

so suppose that a website restricted areas for members and admins. a user navigates to /member, and is prompted for logging in. however the server won't know if the user was trying to access /admin or /member before getting on the log in page, so after logging in the server don't know where to redirect.


first difference:

they are using different web apis. <hashrouter> uses and reads the hash from url, <browserrouter> uses window.history web api.

second difference:

<hashrouter> is used for static one-page website. ideal for browser based projects. <browserrouter> is used for dynamic website. should be used when you have a server that will handle dynamic requests (knows how to respond to any possible url).

Related Query

More Query from same tag