HTML: Hyper Text Markup Language:

HTML is a language for describing hypertext documents. Hypertext documents are made up of headings, paragraphs, bulleted lists, and, importantly, links to other hypertext documents; it’s the links that constitute the hyper part of hypertext. Markup implies adding markup to the plain text to indicate which bits of it are headings, paragraphs, lists, links, etc.

History

In 1990, Tim Berners Lee designed a simple hyper text based system, which called to be known as WWW or internet. In earlier days, when researchers shared their documents amongst computers, each had their document written by a specific software, and unless the other side also had the same software, the only way to read was to convert the document to a format that the software on the receiving computer can read. Tim Lee had written many such utilities, but realized that everyone writing in a single format that is easy to transfer would be the solution. So, he introduced HTML languauge that added tags to document and some other syntax. Then he  developed a viewer called browser that could read this document. Anyone could write their own browser, as it just needed to parse the tags and display the content. Thus, HTML became the default language of internet.

HTML 1.0:

HTML is the language that the content on any website is written in. In earlier days of internet, you could write a simple text file with simple tags to change text style, size, color, etc.. However, this would be simple text file, with no control on how to display it on the page, how to add images, etc. Later a lot more tags were added to make the page appealing to user. However in early days of internet, everyone started defining their own tags which supported only their browser. In 1993, W3C (world wide web consortium) was formed to standardize the process. Soon, HTML 1.0 was introduced. It's called hyper text markup lnguage, since early HTML std had support for mostly hypertext (i.e links which pointed to other HTML docs). 

HTML 2.0:, DHTML, CSS 1.0:

In 1994, Marc Andersson introduced Mosaic browser, and in 1995, Microsoft introduced Internet Explorer. With browser wars starting, HTML 2.0 standard was released in 1995. HTML 2.0 introduced forms which allowed data to be sent back to server.  Shortly after that, Netscape introduced JavaScript that enabled web pages to respond to user actions without going back to the server at all. This allowed web pages to become highly interactive, and came known as dynamic HTML (DHTML). 2 main browsers, Netscape and IE implemented DHTML very differently, and thus had no compatibility. W3C stepped in 1999 to come up with a standard, and IE achieved full compatibility with DOM (dynamic object model) level 1. In the meantime CSS 1.0 standard came in late 1990s which was an addition to HTML.

HTML 3.2:

HTML3.2, introduced in 1996, added widely used features as tables, applets, text flow around images, etc. It was W3C first recommendation for HTML, and was backward compatible with HTNL2.0.

HTML 4.01, XHTML1.0:

HTML 3.2 std was superceded by HTML 4.01 in 1999. With HTML4.01 and CSS2 in early 2000, web became very popular. HTML4.01 added support for more multimedia options, style sheets, scripting languages, etc. Where features were lacking in the standards, developers used JavaScript or third-party plug-ins, such as Macromedia’s (now Adobe’s) Flash, to fill in the gaps. Around this time, W3C decided that the future of HTML lay in XML . XML is superficially similar to HTML —documents, tags, and elements all exist in XML. However, XML is superior in 2 ways: it's more strict in syntax, and it's extensible (i.e new tags can be added by defining them in a new file). W3C redefined HTML 4.01 into XHTML 1.0. It contained no new elements or features; all the valid elements were identical to those in HTML 4.01 . The only changes came from it now being a dialect of XML . The plan was to extend XHTML in a modular fashion by plugging in new XML dialects. Some of the better-known XML dialects the W3C expected to be plugged in to XHTML were Scalable Vector Graphics (SVG) , and M ath ML , an XML language for describing equations.

AJAX:

 In 2004, Firefox browser, which was a desendent of Netscape browser introduced XmlHttpRequest (XHR) object which allowed only a small part of the page to be reloaded instead of reloading the whole page with every click of the user. This made Gmail, which used this, extremely fast and led to a spurt in XHR -based web applications and renewed interest in JavaScript. The approach was soon given the acronym AJAX (for Asynchronous JavaScript and XML). AJAX became very popular because of all the cool things it could do on client side.

XHTML2 vs HTML 5:

In year around 2005, 2 different paths were taken for future std for HTML. W3C continued to work on XHTML 2 which was radically different, while a new group of comapnies started developing HTML 5 which was more evolutionary. HTML 5 started getting more traction, and so in 2007 W3C started working on HTML 5.0 and put XHTML 2.0 on hold. HTML5 intended to replace all previous HTML and XHTML. At the same time, new CSS3 std was being developed, which was modular. it’s split into sections such as Backgrounds and Borders, Values and Units, and Text Layout. In the meantime, until a particular module is ready, the corresponding section of the CSS 2.1 spec is regarded as the current standard. HTML5 and CSS3 were released around 2015. These are the ones that are supported by all browsers as of 2020, and 90% of the websites already use these.

HTML syntax: Even though HTML5 is the latest, we still learn HTML, as HTML5 is backward compatible with HTML.

HTML language, specified "elements" or "tags" told the browser how to display the text content. Browser do not the display the tag, but they use these tags to display the content in a way that the tags tell them to. These tags may also have special attributes defined. If you ever look at the source of any webpage (by hitting "ctrl + U" on firefox, or by going to Web developer->Page source on firefox), you will see that the whole code is in html. Purpose of browser is to read HTML docs and display them.

Below is a link from w3schools website, which is one of the best places to learn programming languages for websites:

https://www.w3schools.com/html/default.asp

HTML tags: Tags in html  are element names surrounded by <> (angle brackets). There is a start tag (<h1>) and an end tag (</h1>) denoted by "/" within <>. Everything from start tag to end tag (including tags) is called an element. Everything between the tags is the content. Content can have tags too, so tags can be nested. Tags are not case sensitive.

ex: <h1> content heading <b> in bold </b> continuation </h1> => here tag <b> is nested within tag <h1>. Here the whole element is called "h1" element since it contains h1 tag on it's outermost. When we say "b" element, it refers to nested element in b tags. (i.e text "<b> in bold </b>")

Attribute: Each element can have additional attributes, which is always specified in the starting tag with name="value" format. value is enclosed in "..". There can be multiple attributes separated by space. Attribute may be optional for some tags, while required for other tags. Some attributes are specific to certain elements, and others can be applied to any element. The two most common attributes are "id" and "class", which are used in CSS a lot.

ex: <a href="/abc.com"> link to abc </a> => Here <a> is starting tag for link and </a> is ending tag. href is an attribute and is required for <a> tag.

HTML document:  An HTML document is a tree of elements descending from an <html> element and its two children: <head> for metadata (literally, “data about data”) and other nonvisible elements, and <body> for the page content. HTML doc is divided in 2 portions: head and body. This is how most html docs will look like: a top level html tag, then within it are a head tag and a body tag.

  1. html: <html> .... </html> =>
  2. head: <head> title="my website" </head> => contains metadata about the page. This is data about the page and is not displayed. Some of the elements used in head are:
    1. title:  shows title in title bar
    2. link: Reference external resources such as style sheets
    3. script: Specify code to be run in the browser
    4. meta: Provide key-value pairs of metadata
  3. body: <body> .... </body> => contains all content to display

Sample html file: You can copy below file in any editor and save it as test.html. Then if you click this file, you will see it open in your browser.

<!DOCTYPE html> => specifies that following doc is in html5 format

<html>

<head>
    <title>Page Title</title>
</head>

<body>
  <h1>My First Heading</h1>
  <p>My first paragraph.</p>
</body>
 
</html>
 
NOTE: for clarity we add newline and spaces in a html file. Even if we put everything in one line, the behaviour of browser regarding how the content is displayed won't change, since only tags are used to tell browser how to display spaces and new lines. All whitespace char in html are collapsed to a single white space.
 

File paths inside html file: Inside html doc, from time to time, we have to specify location of files to access. For example, in hyperlinks, we have to specify url of other websites, while when showing some local picture on our website, we have to specify the path where that picture is. Important to note that we can only access files on the webserver that have correct permissions and and are in the correct dir (i.e dir which apache server is allowed to access).

ex: To access file: pictures/pic.jpg on my local server www.maaldaar.com

A. Absolute path: One way is to specify everything as a url, even if the file is on your local website.

Here, I can specify file as a url: "www.maaldaar.com/pictures/pic.jpg".

However, the above approach is not preferred, especially since you may have a lot of local files that you are referring to, and every time you change your domain name, you may have to change all the links manually to refer to new domain name. Better approach is to use relative path names for pointing to local files:

B. Relative path: Here I specify file as "/pictures/pic.jpg". Here / refers to root of the webserver where that website is located and not to the root of the Linux dir on your computer where that server is installed. We can also specify path as relative to the folder where the current html page is. So, if root has 2 folders "pictures" and "docs", and if the current folder is "docs", then to access the file, we specify "../pictures/pic.jpg". To specify something in current "docs" dir, we specify "my_pic.jpg".

Few imp tags: visible html elements fall in 2 broad categories: block elements and inline elements. Block-level elements should never be children of inline elements, but inline elements can be children of other inline elements.

Block elements: A block element naturally takes up the full width available to it; consecutive block elements naturally start below the previous block element. Below are 3 common block elements.

1. paragraph: <p> my name </p> => my name is in it's own paragraph. Anyhting after this will be in a new paragraph. So, paragraphs automatically cause line break (i.e start of new line)

2. heading: <h1> ... <h6> => headings with h1 being the largest size text, and h6 being the smallest. headings automatically cause line break (i.e start of new line)

3. lists: shows list as bullets or numbers. lists automatically cause line break. ul=> unordered list (bullets), ol=> ordered list(numbered), li=>list items in the list
<ul>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ul>

<ol>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>
 
Inline elements: These fit exactly to their content and sit naturally on the line of text in which they’re situated. The previous and next element are in same line, except if they were block elements. ex are formatting tags, links etc.
 
1. Formatting tags:  <b> = bold, <i>=italic,  <mark>=marked text (highlighted with some color), <small>=small text, <em>=for putting emphasis on text (like putting it in italic)
 
2. quotation tags: <q>=quote, etc. Mostly useful for search engines, parsing etc. Display doesn't necessarily change.
 
neutral elements: A <div> is a block-level element, and a <span> is an inline element. By themselves, these elements are intentionally semantically neutral; they don’t “mean” anything, we can make them mean anything we want. Basically we define the behaviour of new elements to what we want them to be. We will learn about these in CSS.
 
Other tags:
 
comments: <!-- this is a comment --> => comment tag for inserting your own comments. this is not displayed on browser.

line break: <br> => line break tag to start next  text on new line. Closing tag for br is optional and is called "empty element", since br tag doesn't have any content inside it. We can also use </br> instead of <br>.

pre: <pre> => preformatted tag displays inside text as is, with all spaces and line breaks that are there in the text. Otherwise, any text without these tags, is displayed without any extra spaces or line breaks that are in the text (as html parser collapses all whitespaces into one). As the browser ignores extra spaces and line breaks when displaying text, that is why we don't see line breaks or paragraphs in displayed text in browser, even though our html file contains it.
 
image: <img src="w3schools.jpg" alt="W3Schools.com" width="104" height="142"> => shows an image w3schools.jpg on the local server in current dir (image can also be a link to some other website image, it doesn't need to be local). alt speciifes alternative text to display in case image can't be displayed. width/height is in pixels. For our locally installed apache server, images or any document has to be proper permissions and in correct dir, from where webserver is allowed to read file. for ex, if the document is not in /var/..., apache may not be able to read it depending on apache settings.
 
object: <object> element is more general purpose element for embedding content in your page. The <object> element can link to an arbitrary file. The only additional requirement is that you specify the file type. In browsers that support SVG images, <object> can be used to replace <img>.
 
link: <a href="/www.abc.com/intro.php" target="_blank"> link to abc </a> => text "link to abc" links to www.abc.com/intro.php.  target specifies where to open the link. _blank opens the link in new window or tab, while _self opens in same window/tab. Other target attributes are not relevant as they are used for frames (pre CSS days). <a> is the most used tag in HTML, and this is what gives it the name "hyper text". Here href doesn't have to be another url, it can be a file or script on local server. See ex below:
ex: <a href="/scripts/welcome.php" > Welcome >/a> => This has link to php file on local server. so, php file is called, which gets run and o/p sent to be displayed on same window/tab (since target is not specified, "_target" is set to default value of "_self" which opens the doc in same window/tab). NOTE: scripts dir is looked for in current dir where we are right now. Most of the times, we don't change dir, so our current dir is still server main dir.
ex: <a href="/css/custom.asp" target="_self"> link </a> => Link to a script located in the css folder on the current web site."/" in beginning of path refers to staring dir of our website (i.e in whichever dir that website server is installed, that becomes "/" dir for our website. So, if abc.com is installed in dir /home/website/abc, then this dir "/home/website/abc" serves as "/" dir for abc.com). We can omit "/" too as most of the times we are in server main dir, and call all scripts/html_files from server main dir itself, so href="/css/custom.asp" is equally valid.
 
Aside from having text content as a link, we can have image or email also as a link:
ex: <a href="/scripts/welcome.php" > <img src="w3schools.jpg" alt="W3Schools.com" width="104" height="142">  </a> => Here instead of using text, we put <img> tag which serves as the clickable link (in lieu of text) to open the file specified. This is what you see in many websites, where clicking on a picture takes you to another link. It can also be used to make pictures larger on clicking.
ex: <a href="/images/my.png"> <img src="/images/my.png" alt="CHART" /> </a> => Here link is an image which is displayed on current page. However, that image is resized to fit the page, so it may appear smaller. However, on clicking that image, it takes you again to the same image, but now it's the full sized original picture on the same window replacing the earlier small sized picture.
 
email link: <a href="mailto:This email address is being protected from spambots. You need JavaScript enabled to view it.">Send email</a> => This opens the user's email program (to let them send a new email)
 
link to navigate to particular section on page: You see this on a lot of websites, where clicking takes you to bottom of a page or elsewhere. This is easy to achieve by adding #id_name to href link name. We add extra "#" to end of link. The "id_name" is the name that we put on that page within any tag as <h3 id="id_name">
ex: <a href="/www.abc.com/intro.php#mid_page"> link abc <a>. Now we put id name "mid_page" to any tag on the target page, where we want out link to go to. If we couldn't find a suitable place to put the tag, just add any tag as <p> on to your intro.php "html" section, with this tag. i.e add this to your destination page: <p id="mid_page">. Now clicking the link will take you to that section of page, where that id appears. Ofcurse that id name has to be unique on that page, else link will take you to the first id it finds.
 
If you want to link to different section on same page, then you don't need page url, just the # with id. ex: <a href="#para_4"> ... </a>. This takes to section on same page with id="para4". As explained earlier, this "id" can be assigned to any tag.
 
button: shows a button with the name. ex: <button> click me </button> => button "click me" to choose
 
iframe: allows us to create an embedded browser window inside the one the page is rendering in. This is an easy way to allow parts of the page to be updated without reloading the whole thing. The <iframe> element is used a lot for embedding advertising, displaying videos, and Facebook applications.

form: The form element is one of the most imp elements used to collect user input. The user input can then be sent to a server for processing or be used by a script or some other action.We will use forms a lot when learning javascript.
An HTML form contains form elements, as <input> element, <label> element, etc.
input element takes input from the user. It has a type attribute that determines how to take that input. "type" attribute can be text, radio or submit. It also has "name" attribute which assigns a "variable name" for that field, and gets value for that based on whatever user entered. Now we can use that var "name" to do any operation with it. Looks like the scope of this var is for form element only. value may be available outside the <form> tag. When autocomplete is on (autocomplete="on"), the browser automatically complete values based on values that the user has entered before.
There are lot more elements and attributes to be used with form. Look on w3schools.com.
 
ex: below form takes 2 i/p from user in text form (there are 2 boxes in which to enter text, they are prefilled with values "John" and "Doe"). Then there are 2 radio buttons with value male and female, and we can select one of them
<form>
  <input type="text" id="fname" name="fname" value="John"><br> => By default, Value "Joe" is stored in var "fname". If user enters a value, then that's
  <input type="text" id="lname" name="lname" value="Doe" autocomplete="on"> => Here autocomplete is turned ON for this field
  <input type="radio" id="male" name="gender" value="male"><br> => Value "male" or "female" is stored in var "gender"
  <input type="radio" id="female" name="gender" value="female"><br>
</form>

Above form does nothing as the data that user inputs is not used anywhere. We can add input type "submit" and assign an action to take when that submit button is clicked. The action attribute defines the action to be performed when the form is submitted. The target attribute specifies if the submitted result will open in a new browser tab, a frame, or in the current window. default valus is "_self" which means form will be submitted in current window, while "_blank" means form result opens in new window. The method attribute specifies the HTTP method (GET or POST) to be used when submitting the form data. Default method "Get" submits form data by making it visible in page's address field (i.e it becomes part of url), while the more secure "Post" method doesn't make it visible in addr field.

So, above <form> code may be rewritten as:

  <form action ="script/action_page.php" target="_blank" method="get"> => This php script gets run on submitting the form (when we replace the 1st line in above ex with this line).
 <input type="text" ....>
......
 <input type="radio" id="female" name="gender" value="female"><br>

<input type="submit" value="SUBMIT IT"> => This submit attribute causes a "submit" button to appear on the page. On lcicking "SUBMIT IT", url "www.abc.com/script/action_page.php?firstname=John&lastname=Doe" is sent to the server (this is because method "get" was used). Then the server parses this url, gets the data (firstname, lastname) and runs script "action_page.php".

<button type="submit"> SUBMIT IT</button> => button type may also be used instead of <input ..>

 NOTE: In many websites, you see that when you submit inputs, there is a validator that points out errors if any before submitting the form. This is done using Javascript, that we'll learn in Javascript section. We use onclick attr of form. Goto Inline event handler in javascript for an example. 

 Validating HTML document:

Once you have written HTML document, even if the doc is not correctly written, browsers will still display it without throwing an error. So, browsers are forgiving in syntax error, but behaviour is browser dependent. There are HTML validators available online that will validate the document tree. On top of this, browsers also have support for validating. In Firefox, look for the Web Developer menu option (by clicking , and select Inspector. The tools open with a tree view of the markup. Use this to highlight elements you’re interested in and check that the tree structure the browser has built corresponds to what you intended. DOM (Document Object Model) is what we'll see next.

 

Gift Cards:

A lot of companies in USA issue gift cards to buy their items. These gift cards are touted as being perfect gift, as they do not expire, and are better than giving a gift (which the recipient may not like).

Most of the times you can get these giftcards for 10%-20% discount, which makes for nice savings. There are multiple places where you can buy these discounted gift cards. you should never buy a Gift card at face value, without any discount.

Risks of GC:

Gift cards carry a lot of risk, and are not worth the paltry discount for following reasons:

1. Gift cards get hacked frequently.

Gift cards may not expire, but they may get hacked, which is nothing in your control. Once giftcard is hacked and it's balance drained, there is no recourse. The retailer who sold you these giftcards will ask you to contact the issuer of gift card. The issuer of gift card will ask you to go back to the retailer, or they will out right deny the claim. Most of the gift cards have a clause stating that "Gift cards are not refundable if lost or stolen. Protect it like cash". So, basically any hacked gift card is your money lost.

I learned it the hard way with Southwest Airlines gift card that I bought from paypal. About $500 worth of multiple giftcards showed $0 balance on trying to redeem it. I called paypal, and they redirected me to southwest, stating that they are just the processing company, and have nothing to do with gift card themselves. Southwest asks them to facilitate their gift card sale, and they process it, collecting no money for gift card themselves. It all goes to southwest, and they are the ones who should deal with resolution of dispute on their gift cards. Sounded fair.

I called Southwest Airlines and they told me that I should ask Paypal since they sold me a giftcard which is not as what they promised. Paypal are 3rd party merchant, and any dispute has to be resolved with the merchant, from where the gift card was bought from. Kept on switching back and forth between these 2 companies for couple of weeks with no resolution. This is when I had valid receipt/email for the purchase. Ultimately got a southwest rep, who told me that even if the GC was hacked, Southwest would not refund the money as "lost or stolen GC are non refundable". I tried to explain her that a GC getting hacked was a issue on their side (not enough safeguards for preventing fraud), and I shouldn't  suffer. She said I didn't protect it adequately. She suggested that I should change my email password, keep GC number/PIN secret, and lots of other things, implying it was an issue on my side. Ultimately lost $500 trying to save $50. Learned my lesson, or did I yell

2. Gift cards have no clause for refund:

Almost all the giftcards that you buy have no clause for refund. So, don't expect to get paid back if it gets hacked. You can file a dispute with your credit card company, but most of the times, you come to know about the GC hack, only when you try to redeem the GC. Usually it's too late to dispute it with Credit card company. So, use the GC while within the dispute window. Don't hold for more than a month.

3. Returns on items paid with GC get messy:

When you buy an item with a GC, and decide to return it, it gets very messy. sometimes, you will not get any money back, and no one would be able to help you. Many companies have the standard language in their return policy that says that "refunds would be provided in the same mode of payment that was originally used". So, if you used GC, refund goes back to that GC. Most of the times, you have already gotten rid of that GC, so even if they return the money back on that GC, there's no way to access it. No rep can help you getting that GC+pin back, as it's not stored anywhere (at least not the PIN). To make matters worse, a lot of times, the refund amount never makes it back to GC. I had this issue with BestBuy refund, where $400 of refund amount never made it back to original GC. I had to fight for 6 months, and finally I found a nice BestBuy rep, who issued me new GC. Otherwise that money was toast, just because I decided to return an item. So, basically when you return items bought with GC, insist them to issue you a new GC. Otherwise, you can say bye bye to refund.

4. Most GC provide no purchase history:

Some GC allows you to see purchase history (i.e Walmart, ). But most of them don't allow that citing privacy, even though you might have the receipt. Then there is no way for you to see if you spent the GC, or if someone else drsined it off.

5. GC don't provide any protection at all:

Items bought with credit card can be disputed, but items bought with GC are sort of one way traffic. Once bought, you are at the mercy of the vendor.

Safe way to use GC:

  • GC should be used as soon as possible. We should never sit on GC for too long (I mean more than a month or so).
  • Get at least 20% off on a GC, else it's not worth the risk.
  • Grocery store GC, restuarant GC are usually safe, as these are used to buy consumable items  and not refundable anyway. Also, these are targeted less by the hackers, as they can't drain it easily.
  • When buying electronics with a GC, it's risky as there's no protection in case the item malfunctions, and you want to get a refund. There's no credit card company to file a claim. I would strongly recommend buying a "accidental protection plan" with such a purchase, usually if the purchase is of > $200. It usually costs < 20% of the purchase price for 2-4 years of protection. If you are buying from amazon, some of the items are offered 4 yr "accidental protection plan: for about 10%-15% of the price of the device, which you should definitely add. Similarly, ebay, Amazon and bestbuy also offer such protection plan on eligible electronics. Be sure to add "accidental protection plan", and NOT the regular "warranty plan". The default plans under "ebay certified refurbished" or "ebay refursbished" are regular warranty plans.Those regular warranty plans are useless, as they don't cover issues caused due to normal wear or tear, or due to user. Basically they hardly pay any claims, as they will point everything to being caused by user or as part of normal wear and tear. They only cover issues caused by "manufacturing defects" which are hard to prove for any electronics. Since these warranty companies are not regulated by the government, there's no where to file a complaint.

 

Popular GC:

Even though I've listed multiple reasons above for not buying GC, sometimes the discount is large enough to warrant such risk. Also, some GC are less prone to hacking, or are used frequently so that chances of them getting hacked are lower. Most popular GC that you can get on discount are below:

1 Kohls: Usually Walgreens and regional chain Grocery stores (as HEB, Kroger, etc) have sale on them. You end up getting free $10 GC with $50 GC purchase. These are in store offer only. They are offered couple of times every year. Kohls GC can be used to buy a lot of items at Kohls, especially those which are almost free after Mail in Rebate (MIR)

2. Macy's, GAP, JCP: Same story as with Kohls. These GC also go on sale at paypal, newegg and other online tores.

3. Lowes: Usually at Grocery stores as HEB for 15%-20% off. Other places like paypal regularly have them for 105 off, but not worth at 10%. Lowes has gone down the drain since 2020, and everything over there is overpriced compared to HomeDepot.

4. HomeDepot: Usually at Grocery stores as HEB for 15%-20% off. These are rare, since HomeDepot usually has better sales and clearance than Lowes.

5. Dominos: These usually are on sale for 20% about a dozen times a year at multiple grocery stores, walgreens, paypal, newegg, etc. Papa Johns go on sale very infrequently (may be once a year at Kroger online). Coctsco usually have them on sale for 25% off or more, so never settle for 20% off.

6. Chipotle, Subway: These go on sale for 15%-20% off at bestbuy, grocery stores. Taco Bell GC go on sale less frequently, so load up on them when you get them (not the e-card ones, but the physical GC. e-GC have no way to redeem except online or thru app, which may be a big pain). Coctsco usually have Subway GC on sale for 25% off or more, so never settle for 20% off.

  • Buying Subway GC from subway.com: GC selling on subway.com are basically a scam, where they usually offer coupon code for buying GC (i.e $5 coupon for buying $25 GC). These coupon code just have a link,, and no real coupon code that you can apply manually. That's messy. On top of that, the coupon doesn't stack with any other coupon (i.e BOGO etc), so the coupon link is basically worthless (unless you plan to by something at full price). Found it the hard way.

7. BestBuy: These GC usually are not on sale in traditional way, but you may get these at discount when redeeming rewards for credit cards. These are good to have, since there's always something you can buy at bestbuy. As of 2020, I haven't seen much on sale at BestBuy, so may not be worth having anymore. They do price match, so sometimes you may end up with a good deal matching price with amazon.

8. Amazon: These GC usually are not on sale in traditional way, but you may get these at discount when redeeming rewards for credit cards. These are the best ones to have, as you can immediately load it to your account, so there's 0 risk of getting hacked.

9. Target: Target always has it's $500 GC on sale for $450 during black friday week. It's once a year event and lasts for a couple of days. Limit is just one GC per account. Look in "BF deals".

10. Visa, Mastercard, Amex Prepaid debit cards: You get these on sale where they waive the "purchase fee" of $5 (UPDATE 2023: The purchase fees are now $6 on $500 card). Or sometimes you have 5%-10% cashback going on at grocery stores, drug stores, etc with particular credit cards (some Amex cards have 6% flat cashback at grocery stores). You can buy these debit cards and get the cash back. You lose 1% in purchase fee, but you can use these debit cards later to buy groceries, pay medical bills, etc and enjoy the discount. MasterCard debit cards are risky as they are hacked pretty easily, so avoid them. Amex cards are the best, but they aren't accepted everywhere. Visa are 2nd best. Never had them hacked. But there are more stories now on how even they are drained out by hackers, and there's no recourse.

  • As of 2024, lots of online stores don't take prepaid Visa, etc, Amex GC. The virtual prepaid cards are even worse because  99% of the online places may not take it, and you cannot use them in store. Of the whole lot of Prepaid cards, Amex cards are the most likely to be taken at online stores.
    • Tmobile takes only Amex cards for prepaid.
    • Spectrum takes no prepaid cards of any type except the serve Amex card from Walmart.
    • Trash pickup companies like TDS don't accept any prepaid GC at all.

 

Gift Card stores:

Even though I've you convinced that GCs are not worth the discount, I'll still list GC deals below where they are discounted by 20%+. Below are some of the stores that regularly have GC deal.

  1. Wholesale Discount Stores: Wholesale Discount stores as Costco, SamsClub have discounted GC in their stores and on their website all the time. The discounted GC are Southwest Airlines and many fast food chains as Taco's Bell, Dominos, Subway, etc. Discounts are usually from 10%-25%, but sometimes they will have a sale where you get extra 10% off.
    1. Dominos: These GC are always 25% off ($75 for $100GC). On sale they go for $5 less ($70 for $100GC). So, never buy for < 25% from any store (or get a friend to buy it for you, if you don't have membership. These are eGC, so your friend just need to email the eGC to you). 
    2. PapaJohns: These GC are usually 20% off, but on sale they go for 25%/30% off. 
    3. Subway: Usually 20% off, but on sale, they go for $75 GC for $55.
    4. Cinemeark is also 30% off, true for many others GC too. So, look for 30% off discount when many of the GC go on extra sale.
  2. HEB: If you live in Texas, HEB grocery stores have a deal on giftcards at least once a month, where they discont specific GC by 20%. Previously they used to have coupons in store, so you could potentially buy unlimited GC. However, now they have digital coupons which are limited to one per account, so you have to make multiple accounts if you want to get multiple of these. Some of the GC still have physical coupon in store which are unlimited.
  3. Walgreens: Right after HEB comes Walgreens, which have offers every year during Thanksgiving/Christmas, and also about once a month or so. You buy 2 GC and you get $10 Walgreens GC for free. Depending on the lowest denomination card you can buy, your discount will be from 20%-50%. i.e if you bought 2 Cinemark GC = 2x$10=$20, you will get $10 in WGC => 50% off. The best part is that you can use walgreens GC for anything in store or at pharmacy for your prescriptions, so it's equal to cash value.
  4. Kroger: They also have both online and instore GC deals. They also have 4X fuel points on GC, which gives you $1 off per gallon upto $35 (35 gallon is the limit)
  5. Grocery stores: A lot of local grocery chains have discounted GC on sale from time to time. Keep looking or asking employees about any such offers. They are local to a region, so don't get widely advertised on deal sites.
  6. Paypal digital gift card stores: Paypal on ebay usually has 10% off on bunch of gift cards from time to time. However, these are all egift cards, so if they get hacked, there is no recourse. As of 2023, Paypal is no longer affilaited with ebay, so they have GC on sale directly on paypal.com. I've never seen any GC on paypal that can't be bought cheaper at other places. So, in my opinion it's not worth buying any GC from paypal (as larger or same discount exist elsewhere).
  7. Newegg: Newegg has multiple eGC (usually gap/old navy, lowes) on sale from time to time. Look on slickdeals. However, whatever newegg sells is also available on other sites, so I avoid newegg.
  8. Staples / OfficeDepot: Staples have multiple GC on sale almost every few months. As of 2024, OfficeDepot also has few GC on sale (OD gives 20% back in points which can be redeemed for stamps).

 


 

Sticky Gift Card deals:

 

 


 

Costco/SamsClub Gift Card Offers - Buy Various GC on discount online and in store (expiry - ongoing):

Costco/SamsClub GC deals keep coming at least once a month. You get extra 5%-10% discount on top of regular discount. You need to be a member to get full discount, else you will pay 5% fees for buying as a non member. Look for close to 30% discount on fast food GC.

  • Coctco GC to buy when on sale:
    • Dominos: $100 GC for $70-$80 (Close to Best Value, as sometimes Walgreens has it for 33% off)
    • Papa Johns: $100 GC for $70-$80 (Best Value)
    • Subway GC: $75 GC for $55 (Not available anymore as of 2025).
      • UPDATE 11/09/2025: Subway GC available again (Now, it's available for $100 total in denominations of $20 each). Available on sale $100 GC for $80.
    • Cinemak GC: $50 GC for $35 (Close to Best Value, as sometimes Walgreens has it for 50% off)
    • Macaroni grill GC: $100 for $75
    • Gap GC: $100 GC for $80 (regular 20% off discount, same as what you get elsewhere)
    • Misc: Uber, UberEats, Instacart, etc for 25% off 

 

Below are the deals:

SouthWest Airlines GC deals:

These GC are usually 10% off, but from time to time, you get extra 5%-10% off. These are under "Airlines" section => Look in "flights" under travel section for details of the offer: flights

 


 

HEB Gift Card Offers (in Texas stores only) - Buy Various GC on discount (expiry - ongoing):

HEB GC deals keep coming at least once a month. You need to load digital coupon in your account. Then at checkout you scan the barcode from your HEB app. Sometimes they have physical coupons in store too. HEB GC deals usually last a week (deals start from Wednesday and continue until Tuesday of following week). Below are the deals for 2023:

 

 


 

Walgreens Gift Card Offers - Buy 2 GC, get a $10 Walgreens GC free (expiry - ongoing): BEST GC DEAL YOU CAN FIND ANYWHERE !!

Walgreens GC deals keep coming at least once a month. You need to buy 2 of same kind, and add $10 WGC to purchase, which will come out as free. So depending on the lowest denomination card available, you can either get $15*2=$30 cards with $10 WGC free, or $25*2=$50 cards with $10 WGC free, resulting in 20%-50% off on GC. Most of the times you can 33% off with Dominos, TacoBell, etc, while 50% off with Cinemark, etc. No other store can beat that ever. Take 2 GC along with one Walgreens GC, and checkout like normal. At the final checkout, the price of Walgreens GC will be deducted. Always grab the right Walgreens GC (one with W logo on it, and NOT one with "Walgreens" written on it). Else Walgreens may not scan as free GC, and it might be embarrsing to figure out why?

Link with more details => https://thekrazycouponlady.com/coupons-for/walgreens/walgreens-gift-cards

Below are the deals for 2023:

 


 

OfficeDepot and Staples Visa/MasterCard Gift Card Offers - Online and in stores

OD stores regularly have deals on Visa (V) and Mastercard (MC) GC. Usually instore is $15 discount on $300 Visa or MasterCard GC purchase. Since activation fee is about $7 per card, and OD sells max $200 GC, you will end up paying $14 in fees. So, net you get $400 GC for $400 (i.e activation fee is nulled by discount). It's better to buy two $200 GC.Other offer is online where they offer three $100 GC for net $285. Not much of a deal as such.

UPDATE 2025: OD allows the same person to stack multiple offers in the same transaction. The best way to maximize is to buy three $200 Visa gift cards; you should get $30 off ($15*2) in a single checkout and pay $624.So, you end up paying $594 for $600 worth of GC.

Staples stores also have deals for Visa and Mastercard where they waive the activation fee. It turns out to be the same as the deals at OD.

However, the real deal in this offer is if you have 5% cashback on your credit card (Chase Business cards give 5% cashback on office supply stores). Other deal that frequently shows up is on Chase Freedom cards or Bank of America cards where they have regular OD offers (in deals section) for 10% CB with a max limit. You can split the payment among 2 or 3 credit cards that have such offers. So, you net about $20 in cashback. But that is valid only for instore purchase. Online purchase is thru giftcardmall and doesn't code as office supply store. So, either way you make $15-$20 on $400 purchase. These deals run for a week, and seems like Staples run their deals, a week after OD runs their deals.

OD: $400 Visa GC for $400 (in Store) => https://www.doctorofcredit.com/office-depot-max-stores-buy-300-in-visa-giftcards-get-15-instant-discount-12-19-12-25/

OD: $300 Visa GC for $285 (online) => https://www.doctorofcredit.com/officedepot-com-gcm-10-off-100-visa-giftcard-limit-2/

Staples: $200 MC/Visa (in Store) => https://www.doctorofcredit.com/staples-no-activation-fee-on-200-mastercard-gift-cards-12-5-12-11-limit-5-per-day/

NOTE: Visa GC are always less prone to hacking than MasterCard GC for whatever reason, so I prefer Visa GC when looking to bite. Also, drain these as soon as possible (within a week or so), or else you may not be able to dispute it with your credit card company if the card has incorrect amount (Lots of discussion on DOC website links below where people got cards with $0 balance on them) 

Below are the deals for 2023 and later:

 


 

Lowes MasterCard Gift Card Offer - $200 MC Card + $15 Free Lowes egift card  for $215

This deal pops up couple of times a year. It's in store only. Lowes egiftcard has to be redeemed online (i.e submit your receipt online to get $15 Lowes egiftcard, they are not given in store). It's only worth doing when you have 5% cashback in rotating categories on any of the CC. Usually Chase Freedom and Discover CC have 5% cashback at Lowes for at least one quarter every year. Limit of 2 per email addr. So, only get 2 per receipt. If you want to buy more, get separate receipt. Effectively you are getting $15 Lowes GC for $8. Not worth it for such meagre savings.

 

 


 

Current Gift Card deals:

 

 

 

2025:

 

 


 

11/18/2025: Multiple Gift Cards Offer - Black Friday (BF) yearly deals10% off at BestBuy (amazon gc included) and Target (expiry unknown)

There are multiple GC deals, which are available every year around BF. Best ones are at HEB, Amazon, BestBuy, Target, Dollar General, etc. 

These deals are for 10% off, which is worthwhile only for amazon GC, walgreens GC, ebay GC. HEB has theirs at 20% off which is lot better (which is in the HEB GC section above). 

BestBuy GC offer: Best one is Amazon GC on bestbuy, but it's going OOS quick. Walgreens and Ebay GC are other good ones.

Target GC offer: Nothing worth buying

Amazon GC offer: Nothing worth buying. Most are 20% off (even physical GC available for no extra charge). Amazon used to allow buying 3rd party GC with amazon GC, but that isn't true anymore. Promo codes (for using Dicover, Amex, etc) still work on GC.

Dollar General GC offer:  Most GC 15%off, some 20% off. Most stores only accept cash for GC. Not worth buying as you can get same discount elsewhere with credit card.

11/23/2025 (Apple GC ofer): Apple $100 GC + $15 free GC at multiple retailers. It may be worthwhile since 20% off Apple GC last came 2 yrs back, since then the best for Apple GC has been 15% off. It's available every year during Black Friday. Usually Limit of 1 per customer, but some are able to purchase multiple, so YMMV.

 


 

11/12/2025: Walgreens Gift Cards Offer - 15% off at BestBuy

This is THE best discount you can find onWalgreens GC. If you buy prescriptions at Walgreens, you can use these GC and save 15% compared to cash payment.

Limit of 1 only for each of $25 and $50 GC, so max savings of ~$10 only.

https://slickdeals.net/f/18796711-walgreens-50-gc-42-50-25-for-21-25-egc-via-best-buy-limit-one-of-each-face-value-25-and-50

 


 

06/18/2025: ebay Git Card Offer - 10% off  for max $20 discount (valid until  06/30)

I'm seeing any deal on ebay GC after a long time. Bite on it since you still have to buy low cost items from time to time. Buy no more than $200 in GC else you will be charged full price on any amount over $200 in GC.

https://slickdeals.net/f/18389236-ebay-egift-cards-10-off-100-max-20-off?src=frontpage

 


 

06/09/2025: Taco Bell Git Card Offer at amazon - 15% off 

With extra 5% cashback with Chase Freedom cards, it's essentially 20% off. Not the best deal, but nothing better so far this year. Many other cards available too, but nothing worth buying.

https://slickdeals.net/f/18369613-50-taco-bell-gift-card-physical-42-50-free-shipping?src=frontpage

 


 

 

2024:

 

 


 

04/07/2024: Target Git Card Offer - 10% off  (valid only on  04/13)

https://www.doctorofcredit.com/target-circle-week-4-7-4-13-10-off-target-giftcards-more/

Limited to $500 in Target GC per person. Both in store and online.

 


 

 

2023:

 

 


 

03/10/23: Groupon Gift Card Offer - Buy Various GC on discount (expiry - unknown):

Groupon is offering various e Giftcards for 20% off. Popular ones are Lowes $20 for $16, CVS $20 for $16, Papa Johns $10 for $8, Cinemark $26 for $20, etc. 

https://slickdeals.net/f/16502152-16-for-20-lowe-s-egift-card-groupon

 


 

 

2022:

 

 


 

10/28/2022: OfficeDepot Visa Git Card Offer - $200 Visa Card for $192  (expires 11/03/2022):

https://www.doctorofcredit.com/officedepot-com-gcm-10-off-100-visa-giftcard-limit-2/

Free $8. Visa GC may be used anywhere. If you have a credit card that gives 5% cash back for office store purchase, use that (not sure if that will work, as seller is giftcardmall and not OfficeDepot)

 


 

05/24/2022: Kroger Gift Card Offer - $5 off $40+ on any eGiftCard  (expires 05/26/2022):

https://slickdeals.net/f/15806071-5-off-your-40-or-more-egift-cards-purchase-from-kroger-35

Free $5. Buy ebay GC which are never on sale, amounts to 12.5% off.

 


 

04/27/2022: Ikea Git Card Offer - 20% off  (expires 04/27):

https://slickdeals.net/f/15752218-ikea-egift-cards-email-delivery-50-20-off

Limited to $1000 in eGc per person (or per email). They are 20% off. Comments indicate prices are jacked up by 20% or more.

 


 

04/11/2022: Staples Git Card Offer - Buy Groupon, Wayfair, Chipotle, Gamestop $50 GC for $42.50  (expires 04/15):

https://slickdeals.net/f/15721423-50-electronic-gift-card-to-chipotle-groupon-wayfair-and-gamestop-for-42-50-at-staples?v=1

Groupon and Wayfair are the ones worth it. They are 15% off and limited to 3 per user.

 


 

04/06/2022: PayPal Gift Card Offer - Buy $50 JCPenney GC for $40  (expiry=unknown):

https://slickdeals.net/f/15712087-paypal-has-dominos-old-navy-jcpenney-and-h-m-gift-cards-on-sale-40

Buy $50 JCP eGC for $40, GAP eGC is also 20% off, but that's regular discount. Others not worth buying.

 


 

01/31/2022: Best Buy Gift Card Offer - Buy Delta Airlines and hotels.com $100 - $500 GC, get 15% in Best Buy GC (expiry=unknown):

https://slickdeals.net/f/15596401-100-or-500-delta-gift-card-or-100-or-250-hotels-com-gift-card-15-back-as-bestbuy-egc

Buy $500 Delta eGC, get $75 back in Best Buy eGC. Also, buy $250 in Hotels.com eGC, get $40 in Best Buy eGC. Limit 2 for each type of card. Even though the Best Buy GC don't expire, last 2 years, there hasn't been anything at BestBuy at prices worth buying. So, don't accumulate too many of these Best Buy eGC.

 


 

01/05/2022: HEB Gift Card Offer (in Texas stores only) - Buy Southwest, Delta, Uber, Lyft, Airbnb and hotels.com $150 GC, get $25 HEB GC free for each (expires 11th Jan, 2022):

https://www.doctorofcredit.com/h-e-b-purchase-150-airbnb-uber-delta-southwest-get-25-h-e-b-giftcard/

You need to load digital coupon in your account. Then at checkout you scan the barcode from your HEB app. Make sure you add $25 HEB GC to the order along with other GC. You can buy all GC in the same order.

 


 

2021:

 


 

11/25/2021: HEB Gift Card Offer (in Texas stores only) - Buy Home Depot, Kohls, Academy, Childrens's Place, Vanilla Visa $100 GC, get $20 HEB GC free for each (expires 30th Nov, 2021):

https://slickdeals.net/f/15440479-h-e-b-grocery-texas-buy-100-select-home-depot-kohl-s-academy-children-s-place-vanilla-visa-gift-cards-get-bonus-20-heb-gift-card-free

You need to load digital coupon in your account. Then at checkout you scan the barcode from your HEB app. Make sure you add $20 HEB GC to the order along with $100 other GC. You can buy all GC in the same order.

 


 

11/25/2021: Walgreens: Gift card deal: Free $10 Walgreens GC with purchase of 2 $25 Apple GC.

https://slickdeals.net/f/15454639-ymmv-walgreens-stores-2-apple-gc-for-25-each-10-walgreens-gc-for-50

Look in weekly ad for walgreens on walgreens.com. Terms as below:

FREE $10 Walgreens Gift Card with myWalgreens and purchase of any two $25 Apple, Cabela's or Bass Pro Shops Gift Cards.

 


 

10/14/2021: Kroger Gift Card Offer online - Buy any $25 GC for $20 (expires 10/17/2021):

https://slickdeals.net/f/15333310-kroger-buy-any-25-egift-card-email-delivery-for-20-earn-4x-fuel-points

This is free $5. Buy an ebay GC as it's never on discount. If you buy other GC, those usually go on discount elsewhere, so you aren't maximizing your profit. This will expire pretty fast, won't last until 17th.

 


 

06/16/2021: HEB Gift Card Offer (in Texas stores only) - Buy Lowes $100 GC, Home Depot $100 GC or Academy $100 GC, get $15 HEB GC free (expires 06/22/2021):

https://www.doctorofcredit.com/h-e-b-purchase-100-in-giftcards-get-15-h-e-b-giftcards-home-depot-lowes-more/

You need to load digital coupon in your account. Then at checkout you scan the barcode from your HEB app. Make sure you add $20 HEB GC to the order along with $100 GC. This is essentially 15% off, which is not as good as 20% that you get most of the times. You can buy one each of Lowes, Home depot and Academy in the same order. I don't think Academy is worth the 15% discount, as you can easily get it at 20% if you wait.

 


 

06/02/2021: HEB Gift Card Offer (in Texas stores only) - Buy Lowes $100 GC or Home Depot $100 GC, get $20 HEB GC free (expires 8th May, 2021):

 https://slickdeals.net/f/15067939-buy-100-00-in-home-depot-lowes-gift-cards-get-free-20-00-h-e-b-gift-card

You need to load digital coupon in your account. Then at checkout you scan the barcode from your HEB app. Make sure you add $20 HEB GC to the order along with $100 Lowes or Home Depot GC. This is essentially 20% off, which is as good as it gets for these 2 stores. You can buy one each of both Lowes and Home depot in the same order.

 


 

05/09/2021: Walgreens Gift Card Offer - Buy Kohls 50 GC or Burlington $50 GC, get $10 Walgreens GC free (expires 15th May, 2021 - will run out of stock fast !!):

https://slickdeals.net/f/15013942-free-10-walgreens-gift-card-when-you-purchase-any-two-kohl-s-chili-s-burlington-fanatics-or-spa-wellness-gift-cards-in-store-only-30

The other cards in the deal aren't of much value. You will need to buy two of $25 GC and then add $10 Walgreens GC in store. At checkout, it will show discount of $10, making Walgreens $10 GC free. I Came to know that it has to be Walgreens GC which has Walgreens logo on it. There is some specific Walgreens GC that doesn't get discounted.

 


 

Warren Buffett is among the richest people on earth, and has amassed all of his wealth via stocks. So, it's helpful to analyze what stocks he buys or sells. This information is publicly available.

Warren buffett is the chairman and CEO of the company "Berkshire Hathaway" t(aka BH) hat he founded. Berkshire Hathaway was a textile company that he bought in 1960's. It was a money losing company, but Buffett started adding other businesses to Berkshire Hathaway. He started buying shares of other companies, as well as buying whole companies. Thus over years, it has become holding conglomerate company, which has lots of wholly owned companies as GEICO, BSNF Railway, etc, as well as having partial equity stake in other companies as Apple, Wells Fargo, etc (by buying stocks of these companies).

Berkshire Hathaway's market cap is about $500B as of Dec, 2019. It trades on the stock market as any other stock, and has 2 classes of stock. If we look at BH cash and equivalents, we see that BH has $200B in stocks. $100B or so in cash, and 100's of wholly owned companies which market values at about $200B based on the income they generate. Hence the $500B valuation of the company. As you can see about half of BH stock valuation is based on value of stocks that it owns. So, BH stock can also be seen as a mutual fund index, whose price goes up/down based on stock price of it's holdings. so, a lot of people prefer owning BH stock instead of holding an index fund as "S&P500", as BH stock holdings have always risen much more than S&P500 holdings. On top of that, wholly owned companies of BH also generate more cash and grow more profitably than the market as a whole, so their valuation also keeps on increasing. Also, BH keeps a lot of cash on hand, so anytime there is a severe market correction, BH invests that cash to buy stocks at lower prices. But that's assuming, BH can time the market, which is almost impossible. Anyway, the end result of al this is that BH stock has given a return of about 20% compared to S&P500 return of 10%. However, BH stock doesn't pay any dividend.

Warren buffet's wealth is around $100B of which, 99% of it is held in BH stock. The remaining 1% of his wealth is in personal portfolio of stocks, which pretty much mirrors the stock holdings in BH. This personal portfolio allows him to get dividends in tens of millions, which becomes his income for tax purpose. Since 100% of his income is from dividends, he pays a very low 15% long term tax on his income. I've no idea, why he doesn't have all of his wealth in BH stock, when he can get away with paying any tax at all. Since Buffett doesn't have high expenses due to his cheap lifestyle, he doesn't need those dividends at all.

 Personal Portfolio: This link lists stocks owned in his personal portfolio:

https://www.gurufocus.com/news/88541/lessons-from-warren-buffetts-personal-portfolio

 BH Portfolio: This link lists stocks owned in BH portfolio:

https://www.simplysafedividends.com/intelligent-income/posts/4-warren-buffett-s-dividend-portfolio

As of Sept, 2018: $200B of stocks were owned byBerkshire Hatahaway Portfolio. There were 45 stocks in this, of which 34 paid a dividend. $100B in cash and short term investments still remains in the portfolio which is getting invested in stocks little at a time.

1. Apple: 25.8% (=$50B)

2. Bank of America: 11.7% (=$24B)

3. Wells Fargo: 10.5% (=$22B)

4. Coco-Cola: 8.4% (=$17B)

5. Kraft Heinz KHC : 8.1% (=$16B)

6. AMEX: 7.3% (=$15B) => 70% of portfolio is comprised of just 6 stocks

7. US Bancorp : 3%

8. Goldman Sachs: 1.9%

9. Moodys: 1.9%

10. JPM: 1.8%

11. Bank of New yourk, Mellon: 1.8%

12. Delta airlines: 1.7%

 

FIXME: moved to "Investing in stocks"

 

 

 

Main driver of Stock Market:

Most of the stock market is owned by people in USA via their retirement accounts (401K or IRA accounts). Some people also have personal brokerage accounts. Only about 50% of Americans have any ownership in stocks.

Very good article on fool.com showing stock ownership (All data as of 2019): https://www.fool.com/research/how-many-americans-own-stock

UPDATED 2025: Of all the financial assets owned by Americans, equities account for 45% of their total asset. Link => https://finance.yahoo.com/news/americans-more-money-stocks-ever-090052709.html

USA stock market is about $45T as of 2022. Number of American households is about 130M as of 2022. Of these, 50% or 65M households own stocks. Out of this 65M, 45M own stocks via retirement accounts only. Remaining 20M or so also have additional personal brokerage accounts, in which they keep stocks. In 1990's, stock ownership used to be in 30% range, and it has kept increasing with now 50% of American households owning stocks. That increase is mostly due to more American participating in retirement plans. In 1989, only 17M families had 401K accounts, while as of 2010, 50M Americans had 401K (Based on above link, at most 65M American families have retirement accounts of 2022).

  • Top 1% American households own 50% of stock market.
  • Top 10% own 90% of US stock market which amounts to $40T of stock market wealth.
  • Bottom 50% of people who own stocks own < 1% of stock market, and own less than $40K in stocks (including retirement accounts) per family. So, we may safely ignore this group as it's insignificant with such low stock ownership. So, we may say that only about 30M or so households have > $40K in stocks. 
  • Of the 20M families who own personal stocks, 50% of them have < $25K in personal brokerage account. So, we may ignore this group too, which leaves us with just 10M families who have > $25K in personal brokerage accounts, and probably > $100K in retirement accounts.

This link from another site shows the ownership which matches the one from above: https://wallethacks.com/stock-ownership-in-america

What's interesting to note from above link is that of the top 10% of earners (those making > $100K/year), 95% own stocks and their median value is $363K.

Combining the data, we see that just 7M or 5% of families own stocks > $400K (including personal + retirement accounts). This is the group that keeps getting rich and richer every day doing nothing.

Retirement Accounts: The main driver of stock market is retirement account which have nowhere else to invest in, except in stock market.

www.ici.org: gives all details of such accounts. Fact sheet(for year 2010): http://conferences.ici.org/pdf/2011_factbook.pdf

total US retirement market: $17.5T.

  1. IRAs: 49 Million households owned IRAs. IRA assets: 4.7T, share of mutual funds and securities thru brokerage a/c = 3.9T
  2. DC Plans: 401K, 403(b), 457, etc: Assets: $4.5T. 401K held $3.1T in assets, while 403(b) and 457 held $0.9T in assets.
  3. Other Plans: fed/state/local pension plans, fixed/variable annuity reserves at life inc co., Assets: $8.3T

Mutual funds accounted for $4.7T  of this 17.5T market.  60% of this (2.8T = 2.1T in domestic equities and 0.7T in foreign equities) is invested in equities.

Link: http://conferences.ici.org/pressroom/news/10_news_ebri_ici_nov

401K accounts:

An estimated 51 million American workers were using 401(k)s at year-end 2010, and assets totaled about $3 trillion. The average account balance of workers was $60,329 in 2010, compared with $58,351 in 2009. Fidelity Investments is the largest provider of 401(k) plans with almost 11.7 million participants.
On average, at year-end 2009, 60 percent of 401(k) participants’ assets were invested in equity securities through equity funds, the equity portion of balanced funds, and company stock. Thirty-six percent were in fixed-income securities such as stable value investments and bond and money funds.

Total assets in stable value funds: According to the Investment Company Institute (ICI), total assets in 401(k) plans amounted to $2.7 trillion (www.ici.org/home/retmrkt_update.pdf) in 2006. GICs/stable value funds and money-market funds, accounting for 15 percent of the total, amounted to about $405 billion in 2006. Balanced funds, at almost 13 percent of the total, held about $348 billion in 2006.

Latest Data:

From a report from Sept, 2019 (when Total USA stock market cap was $30T), Fidelity reported that out of 30M retirement accounts, 200K of 401(K) accounts had balances of $1M or more.  On average, Contribution rate of employees was 8.8%, while employers contributed 4.6%, resulting in total contribution of 13.4%. So, basically 13% of employees income goes into 401(K). Apart from 401(K) accounts, most people also have individual retirement accounts like Roth, etc. The number of such accounts with $1M or more also hit all time high at 182,400 accounts. This is the highest number of retirement account millionaires ever. All of it is a result of strong bull market that saw S&P500 index go up 5 times from 2019 to 2019. So, basically, $200K or so from 2009 grew into $1M by 2019. The avg account balance in 401(K) was $105K, which was also all time high. It's much lower amount, since it includes young people also, who have very little in their 401(K) accounts. $1M used to be the gold standard for retiring. However, Charles schwab survey showed that $1.7M is the new number for retiring in USA. This is all assuming 10% stock market return for ever (which is a return that can only be sustained by Government's ponzi scheme).