Using Chrome Developer Tools, i have printed a JSON object with console.log.

is there a way that I can copy it to the clipboard?

  • 2
    change console.log(myObj) to copy(myObj) (see the docs)
    – user383438
    Apr 22, 2021 at 21:58

4 Answers 4


If the right-click -> copy is not available you could try:

1 - Right-click the object and select "Store as global variable"

2 - The console will print the new variable's name, for example:


3 - Type:


The object is now available in your clipboard.

Tested in chrome 36

  • 3
    In Chrome 41 this returns undefined.
    – isherwood
    Mar 20, 2015 at 14:32
  • 1
    @EdwinSnts Bertrand means in the Javascript console, after logging an object with console.log( myObject ), to right click on that object. It will give you a context menu with the "Store as global variable" feature.
    – BradGreens
    May 8, 2015 at 16:37
  • 14
    copy(temp1) works in Chrome 46, but copying a larger object (a jQuery.Event object), the clipboard gets [object Object].
    – sealocal
    Nov 9, 2015 at 19:33
  • 8
    In Chrome copy(temp1) returns undefined but the object is available in your clipboard.
    – Suzana
    Jan 27, 2016 at 16:42
  • 3
    @sealocal: Yes, I also experienced this with a large object. Kind of irritating, because it is speacially on large objects this would be useful.
    – awe
    Sep 28, 2018 at 6:59

Another simple method...from the console surround the json with JSON.stringify(yourobjecthere). Then highlight the text or optionally select the Copy button in the developer bar if it exceeds X number of rows. Hope this helps someone.



The answer given by @Bertrand works.But it won't when there is already an element by name copy in the Dom.

Doing copy(temp1) gave me Uncaught TypeError: copy is not a function

So I removed that element from the Dom in my console using the below line: document.querySelector('#copy').remove()

Now copy(temp1) works!

  • Thanks, this worked when nothing else on the internet did. This should be the real answer.
    – Antimony
    Feb 22, 2022 at 2:39
  • This is the solution when you've opened a terminal on a random website to play with an object :D Jun 2 at 10:32

Select the text in the console, then use right click -> copy

To copy the entire log (when I needed): hit ctrl-a (select all) then ctrl-c (copy)

Note: Since posting this I noticed sometimes it is necessary to select a little text before these steps work. Also for a long console output scroll to the top of the console and select a little text first. Grrr... still this is easier than saving as a file.

== Above is using Chrome 35 ==

  • 1
    Doesn't work for me—it just copies the collapsed summary of the variable. Dec 12, 2017 at 3:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .