Web Technology Basics

3,000 bytes of image data are encoded with Base64 and embedded in HTML. If no line breaks are inserted, which of the following is the number of characters after encoding?

  1. A2,250 characters
  2. B4,000 characters
  3. C6,000 characters
Show answer and explanation

Answer: B. 4,000 characters

Base64 splits every 3 bytes (24 bits) into four 6-bit groups and represents each with one of 64 characters. The size therefore becomes 4/3 of the original, 3,000 ÷ 3 × 4 = 4,000 characters. When the number of original bytes is not a multiple of 3, "=" is added at the end to fill out a 4-character unit. Embedding an image in HTML or CSS reduces the number of requests, but the data becomes about 33% larger, and the browser can no longer store it as a separate file and reuse it.

  • A. This multiplies by 3/4 instead of 4/3.
  • B. Correct. 3,000 ÷ 3 × 4 = 4,000 characters.
  • C. This is the number of characters when each byte is written as two hexadecimal characters.
Practice this topic Back to topic

Books on Web Technology Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Web Technology Basics questions

  1. A web system is built in three tiers: a web server, an application server and a database server. Which of the following is the processing that the application server mainly handles?
  2. Which of the following correctly describes a reverse proxy?
  3. With CGI, the web server starts the program as a new process every time it receives a request, and the process ends when processing is finished. Which of the following is the main reason that FastCGI and application-server approaches can handle many requests more efficiently than CGI?
  4. Among the ways of producing the pages of a website, which of the following generates the HTML files of all pages in advance at the build stage and returns those files as they are in response to requests?
  5. Which of the following correctly lists the elements in the first line (the request line) of an HTTP/1.1 request?