It's possible to browse the commands previously run in the console by pressing the up and down arrow keys. I want to clear this history. How can I do this?
-
1If your console gets too big, chrome on Windows gives this error: `Error saving setting with name: consoleHistory, value length: 6367742. Error: Failed to set the 'consoleHistory' property on 'Storage': Setting the value of 'consoleHistory' exceeded the quota.` Clearing the console history fixes this. – Josiah Sep 28 '16 at 10:46
-
1Possible duplicate of [how do I clear google chrome console suggessions](http://stackoverflow.com/questions/18885409/how-do-i-clear-google-chrome-console-suggessions) – user Dec 01 '16 at 08:51
-
Related posts - [clear javascript console in Google Chrome](https://stackoverflow.com/q/3011600/465053) & [How to clear Chrome console by shortcut keys?](https://stackoverflow.com/q/5483451/465053) – RBT Jun 21 '19 at 02:17
10 Answers

- 5,755
- 4
- 37
- 54
-
43While the other answer is a super cool "chromeception" moment, this should be the top voted/correct answer now. – KhalilRavanna Jul 06 '16 at 21:50
-
This was the only working solution for me. The "chromeception" variant crashed when trying to examine the Localstorage resources on the second Devtools window. Likely because there was too much data in my history – Mischa Rodermond Jul 15 '16 at 08:33
-
4
-
5This should be top answer, as the accepted answer is no longer correct. – neilsimp1 Nov 29 '16 at 18:32
-
2I didn’t find this option because it depends on where in the console you click. If you click within the line of text where you type, you get a different menu which doesn’t have this option. I think your answer should mention that. – Timwi Apr 19 '19 at 13:34
-
If you want to clear the list of last typed commands, follow these steps:
(Step 1 and 2 are important, don't skip them!)
- Undock the console (click on the icon in the bottom-left corner,
).
(if you don't see, but
, then hold the mouse pressed for a few seconds to get the desired icon)
- Press Ctrl + Shift + J to open the console for this console. (On OSX use Cmd + Option + i)
- Go to the Resources tab, "Local Storage",
chrome-devtools://devtools
. Right-click on the item with key "consoleHistory", and choose "Delete".
Done! You may close the new console, and then dock the previous one if wanted. The console history will be gone when you reload the console.
If you just want to clear the console log (not the commands), just press Ctrl + L.
You could also use Incognito mode if you don't want to keep the list of commands you're going to type.

- 341,306
- 83
- 791
- 678
-
I did not find "consoleHistory" on Resources tab. there is only Frames, Web SQL, IndexedDB, Local Storage, Session Storage, Cookies, Application Cache – Herry Kusmadi Jan 15 '14 at 22:25
-
-
3still not find in local storage, because no chrome-DevTools in it. see this http://i.imgur.com/Cs43DRL.png – Herry Kusmadi Jan 15 '14 at 22:35
-
16
-
7This is a 'debug the debugger'. I think it could be helpful to explain that there is no "official" feature to clear the console history, rather this very, very clever and useful hack. – Zero Distraction Dec 29 '14 at 05:44
-
1
-
The second console window will close automatically for me after a few seconds. It also does not give me the option to right-click. – docta_faustus Dec 18 '15 at 15:19
-
1@docta_faustus Works fine for me in Chrome 47.0.2526.80. The first step is slightly different (these icons are now hidden behind a dotted line at the upper-right corner), but the rest of the answer is still valid. – Rob W Dec 18 '15 at 15:22
-
@Martin It still works for me in Chrome 49.0.2623.75. Did you close and re-open the devtools after deleting the entry? – Rob W Mar 18 '16 at 15:41
-
There is no entry at all. I have only `localhost` in my **Local Storage** dropdown. Nothing with `chrome-devtools://` – xyhhx Mar 18 '16 at 15:42
-
2@Martin In that case, please read every step in my answer (and all comments below it, since you are repeating exactly the same mistake). – Rob W Mar 18 '16 at 15:43
-
-
1Wow! This is like "Inception" – dream within a dream... And yes, I tried other "levels of dreams" and they looked similar to the 2nd level of debugger. – Ricardo Sep 22 '16 at 17:22
-
13On Crome `53` (an maybe earlier versions too), the `Resources` tab is `Application` – Ricardo Sep 22 '16 at 17:25
-
Pls notice that opening debugger's debugger may cause some side-effects on the debugger. I had to restart Chrome to fix them. – Ricardo Sep 22 '16 at 22:14
-
1Even I tried to be smart and skipped the steps, then I realized how fool I was :/ . – ashishyadaveee11 Apr 03 '17 at 07:10
-
2Super cool solution. While rightclick + clear console history clears everything in an easier way, I was able to use this to replace a password I used in the history string. This way I didn't lose my history :) – tietze111 Jun 01 '18 at 06:43
-
2In newer versions of Chrome (as of this writing, Chrome 69) there's no need to undock the console. Instead, just look under the Application tab and select Local Storage in the left sidebar. But the other answers are more up-to-date anyway. – Galen Long Oct 03 '18 at 19:46
-
2Why it is so complicated? Chrome should provide a simple button to clear history. – aagjalpankaj Jun 19 '19 at 16:55
-
1Actually as of chrome 93 and possibly sooner all you have to do is right click on the console display itself. – wheredidthatnamecomefrom Sep 13 '21 at 18:50
I found a quick way to do this with cool keyboard shortcut:
Inside chrome console
- Press Ctrl + Shift + P
- You will see this awesome command palette opened:
- type
clear
and you will find it :)
That's it!

- 2,504
- 1
- 17
- 20
-
10This should be the accepted answer as the other ones do not work in the latest version of Chrome. – Bennett Jan 12 '18 at 04:38
-
This didn't clear assignments. Is there any easy way to clear all the assignments and variables? – iheathers Dec 27 '20 at 05:30
If you don't want to have this console history (like myself), simply disable it from the devtool's configuration options (see on the image) below ...

- 3,229
- 29
- 32
-
1Thanks! Exactly what I was looking for. I like the history being there when I press up & down, but one local app's history being autocompleted when working on another app is... not useful. – chadoh Jun 17 '16 at 12:45
This is very simple, just right click the console window and select Clear console history
, then refresh the page.
Please note, refreshing/reloading that tab is required.

- 4,681
- 3
- 17
- 25

- 878
- 1
- 9
- 14
I ended up here looking for how to do the same thing in Firefox.
In case anyone else does the same, there is a clearHistory
command in the Firefox console which will do just that.

- 3,215
- 3
- 25
- 26
Simply enter clear()
in the chrome console to remove all previous text there.

- 4,047
- 5
- 27
- 55
-
9
-
3This is helpful for when the console is crowded, but not for what the question is asking. It helps, though – Radvylf Programs Aug 15 '18 at 02:38
It can also be fixed by going to the developer tool settings and resetting to defaults.. (this will not reset 'Chrome', only developer tools options)
- Open Chrome devtools
- Go to settings (or press Windows ->F1 / OS X -> FN + F1)
- Reset to the defaults
This way you will lose your developer settings, but for me the only thing that mattered was turning cache off again..

- 1,659
- 2
- 22
- 39