> For the complete documentation index, see [llms.txt](https://asad-razvi.gitbook.io/javascript-cookbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asad-razvi.gitbook.io/javascript-cookbook/console-recipes/how-to-colour-text-in-the-browser-and-server-console.md).

# How to colour text in the browser and server console

```javascript
// How to colour text in the Browser Console
const colour  = 'color:red'
const message = 'hello world' 
console.log(`%c ${message}`, colour)

// How to colour text in the Server Console
const colour  = '\x1b[31m'
const message = 'hello world' 
console.log(`${colour} ${message}`)
```
