As I'm sure that pretty much everyone on here is aware the "Tab" key when used on a webpage simply jumps to the next element on the page; whether is be a checkbox, radio selector, button, another textbox, a link, etc.

What I am hoping to do is enable me to use the tab key whlie I typing something up in an input form and actually have it insert the tab character into the form I'm filling out. I'm pretty anal retentive when it comes to how my text documents are formatted, ESPECIALLY when it comes to writing articles for my site. Hell, I'm even anal about how my "to-do" lists look when I type them up in good old fashioned Notepad. (Yep, I use good old-fashioned Notepad to write up my article ideas, to-do lists, save little snippets of useful code that I find, etc.)

I realize that there are javascript solutions or properties you can set for that particular textbox - depending on what language you happen to be programming the site in - that you can use to manually program the input fields on your webpage to allow this; but I am more interested in allowing the web browser to behave in its normal fashion (as I do use the tab key to switch between page elements - also especially when filling out long applications and forms in order to navigate between them far more quickly than having to use my mouse to click on each field that I want to fill out.

So, what I'm hoping to find is the Windows ASCII key combo (like using ALT+0169 in order to produce the © character) that I can enter in order to insert the tab into the webpage textbox that way. As I use ASCII key combos routinely to make weird-ass symbols in my write-ups all the time I am quite used to doing things this way. Besides, once done typing up something in a textbox I'd still like to have the ability to tab over to the next element. When programming forms myself for whatever project I happen to be working on I always go out of my way to order the elements in such a way that tabbing through them is as intuative as possible. Who knows how many of you are like me, but I am always bothered when I'm filling out a set of address fields and when you cycle though them they jump around randomly based on whatever order the programmer of that page created them in.

EXAMPLE: You're typing in your name in the first field on a page that has a form that hasn't been properly setup I am always annoyed when I, press tab, and then it suddenly jumps to the City name, followed by the address line 2, then to the zipcode, etc. You get the idea. As far as I know everyone likes to input that information in the order in which you'd hand write an address on an envelope. Name first, followed by address lines one and two, then the city, state, zip, and finally (if neccessary) the country assuming that it's required.

Now that I've explained what I'm trying to do ad nauseum, what is the ASCII key code for Tab?

  • 1
    The way you input the Tab character doesn't matter - it will always have the same effect! This is why some programs accept "\t" for tab. – harrymc Sep 8 '10 at 15:09
  • @harry - unless you do it say, in a web browser (try it in one of these comment boxes for example) where instead the Tab key causes a change in focus. And entering \t technically isn't entering a tab charater - it's entering an escape / control sequence to represent a tab.... – DMA57361 Sep 8 '10 at 15:10

Didn't read most of you post, sorry.

But just fixing on the final little question what is the ASCII key code for Tab?
ASCII value for tab is 9 (decimal or hex), so try Alt + ( Numpad 0 , Numpad 9).

But, I've just tested doing so in this very edit box and it doesn't work, but it does in notepad, MS Word, etc. I wonder why...?

Anyway, if you really need a tab somewhere odd, try copying one from notepad and pasting it where you need it - that's what I tend to do.


If you're doing this for it to be displayed on a website (which is what I think you're implying), a tab character may be ignored because HTML tends to ignore whitespace (outside of pre blocks, etc).

If it is HTML you could also use the HTML entity version 	 as well, but this will function in the same way.

  • This actually works perfectly for me. I use Wordpress as my content management system for my sites, which has a WYSIWYG editor for what you're writing. Hitting the tab key while typing in the main content input box just makes it pan to the next field, however, when using ALT+09 (or ALT+009) as suggested by JNK then it tabs nicely within the box I happen to be using at the time. – Sootah Sep 8 '10 at 16:29
  • A bit late, I know, but if you will take a look at section on the contents of raw text and escapable raw text elements) on w3 site you will see why it didn't work for you in the edit box. – Randall Flagg Jun 28 '16 at 12:00
  • This is the answer for me in a different context: I am editing text in a TiddlyWiki (JavaScript-based single-file serverless wiki), which means editing in a text box in the browser. Hitting the Tab key is interpreted by the browser and moves the cursor to the next field, where I need to actually enter a 'hoizontal tab' character (ASCII 0x09), and the ALT+09 method works for that. – Codex24 Mar 22 '19 at 18:48

The code is ALT+009

However, I don't think it will accomplish what you are after.

  • This works fine in Chrome – Asu Jul 7 '17 at 16:12

Hope this helps you -- you have quite a long question :-)

Wikipedia Tab key.

Several tab characters are included as ASCII control characters, used for text alignment. The most known and common tab is a horizontal tab (HT), which in ASCII has the decimal character code of 9, and may be referred to as control+I or ^I. A vertical tab (VT) also exists and has ASCII decimal character code 11 (control+K or ^K). The EBCDIC code for HT is 5. The VT is 11 or hex 0B, the same as ASCII. The horizontal tab is usually generated by the tab key on a standard keyboard.

but, do read the rest of the article.

  • The ASCII code for tab is 09.

  • Pressing Alt + 09 in an online form might not provide you Tab character probably because of the browser. But works in some other software applications like Notepad, Wordpad, Garena etc

If you are scripting your own HTML page and if you need to give HTML tab then you could provide this using

  • Tables
  • CSS
  • DD tags

Here have a look here http://htmltab.kb-creative.net/

and Harry is right , if your coding javascript then you could use \t


Using the Alt-key shortcut gives the exact same behaivor as just hitting the key. If you want to use them, you can fire up Notepad, copy a tab, then paste it into the textbox. When the text is posted, some websites might strip out those characters, however. HTML usually ignores excess whitespace anyway, so even if it did make it onto the page source, nothing would happen.

 <- a tab

On Stack Exchange sites, tabs are interpreted as denoting code blocks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.