HTML5 Local Storage

What Does HTML5 Local Storage Mean?

HTML5 local storage is a component of the Web storage application programming interface. It is a method by which Web pages locally store named key/value pairs inside a client’s Web browser. Similar to cookies, this saved data exists – even when you close a browser tab, surf away from a current website, exit a browser tab or close a main browser. Unlike cookies, this data is not carried to the remote Web server unless it is sent manually. Because HTML5 local storage is natively integrated into Web browsers, it is available without third-party browser plug-ins. It is described in the HTML5 specifications.


Local storage is mainly used to store and retrieve data in HTML pages from the same domain. Even after restarting a browser, the data can be recovered from all windows in the same domain. This type of storage offers numerous options for Web apps.

Browsers, such as Firefox 3.5+, Internet Explorer 8.0+, Chrome 4.0+, Safari 4.0+, Mobile Safari (iPhone/iPad), Opera 10.5+ and Android 2.0+ support HTML5 local storage.

Techopedia Explains HTML5 Local Storage

HTML5 local storage is structured on named key/value pairs, unlike other databases that make use of SQL-intense applications. Data is stored based on a named key. After that, data may be retrieved using the same key. The named key is in a string format. The data may be of any type supported by JavaScript, such as Booleans, strings, floats or integers. Even so, the data is generally saved as a string. If users store and retrieve anything other than strings, they must make use of functions, such as parseFloat() or parseInt(), to coerce the recovered data to the expected JavaScript datatype.

From the JavaScript code, HTML5 local storage may be accessed through a localStorage object on the global window object. The localStorage object stores the data without any expiration date. The data is not wiped, even after closing the browser, and may be accessed at any time. Because it is client-side, stored data is based on the browser that is used.


Related Terms

Latest DevOps Terms

Related Reading

Margaret Rouse

Margaret Rouse is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical, business audience. Over the past twenty years her explanations have appeared on TechTarget websites and she's been cited as an authority in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine and Discovery Magazine.Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages. If you have a suggestion for a new definition or how to improve a technical explanation, please email Margaret or contact her…