---
title: Diode vs Transistor
title_en: Diode vs Transistor
description: A visual breakdown of semiconductor devices — the structural and functional differences between a diode (1 PN junction) and a BJT transistor (2 PN junctions), and the key insight that a transistor "contains" diodes inside it.
sidebar_label: Diode vs Transistor
---

import styles from './styles.module.css';

<div className={styles.page}>
<div className={styles.container}>

<div className={styles.header}>
  <div className={styles.headerLabel}>Semiconductor devices, illustrated</div>
  <h1 className={styles.headerH1}>
    <span className={styles.spanD}>Diode</span> vs <span className={styles.spanT}>Transistor</span>
  </h1>
  <div className={styles.subtitle}>Not the same device — but a transistor has diodes hidden inside it</div>
</div>

<div className={styles.cards}>

<div className={`${styles.card} ${styles.cardDiode}`}>
  <div className={styles.cardTitle}>DIODE</div>
  <h2 className={styles.cardH2}>One-way valve</h2>

  <div className={styles.diagramWrap}>
    <svg width="260" height="100" viewBox="0 0 260 100">
      <line x1="20" y1="50" x2="75" y2="50" stroke="#00e5ff" strokeWidth="2.5" />
      <polygon points="75,25 75,75 120,50" fill="rgba(0,229,255,0.15)" stroke="#00e5ff" strokeWidth="2" />
      <line x1="120" y1="25" x2="120" y2="75" stroke="#00e5ff" strokeWidth="3" />
      <line x1="120" y1="50" x2="175" y2="50" stroke="#00e5ff" strokeWidth="2.5" />

      <circle r="4" fill="#00e5ff" opacity="0.9">
        <animateMotion dur="1.8s" repeatCount="indefinite" path="M 20 50 L 165 50" />
      </circle>
      <circle r="4" fill="#00e5ff" opacity="0.6">
        <animateMotion dur="1.8s" begin="0.6s" repeatCount="indefinite" path="M 20 50 L 165 50" />
      </circle>

      <rect x="75" y="30" width="23" height="40" rx="4" fill="rgba(255,77,109,0.25)" stroke="#ff4d6d" strokeWidth="1" />
      <text x="86" y="54" textAnchor="middle" fill="#ff4d6d" fontSize="11" fontWeight="700">P</text>

      <rect x="103" y="30" width="23" height="40" rx="4" fill="rgba(76,201,240,0.2)" stroke="#4cc9f0" strokeWidth="1" />
      <text x="114" y="54" textAnchor="middle" fill="#4cc9f0" fontSize="11" fontWeight="700">N</text>

      <text x="20" y="80" fill="#64748b" fontSize="10" textAnchor="middle">Anode A</text>
      <text x="185" y="80" fill="#64748b" fontSize="10" textAnchor="middle">Cathode K</text>

      <text x="130" y="20" fill="#00e5ff" fontSize="10" textAnchor="middle">→ Current only flows this way</text>
    </svg>
  </div>

  <div className={styles.cardInfo}>
    <strong>1 PN junction</strong>, 2 terminals<br />
    Forward bias → conducts<br />
    Reverse bias → blocks
  </div>

  <div className={styles.tags}>
    <span className={styles.tag}>1 PN junction</span>
    <span className={styles.tag}>2 terminals</span>
    <span className={styles.tag}>Rectification / protection</span>
  </div>
</div>

<div className={`${styles.card} ${styles.cardTransistor}`}>
  <div className={styles.cardTitle}>BJT NPN ／ Transistor</div>
  <h2 className={styles.cardH2}>Current amplifier</h2>

  <div className={styles.diagramWrap}>
    <svg width="260" height="110" viewBox="0 0 260 110">
      <line x1="20" y1="55" x2="85" y2="55" stroke="#ff6b35" strokeWidth="2.5" />
      <line x1="85" y1="25" x2="85" y2="85" stroke="#ff6b35" strokeWidth="4" />
      <line x1="85" y1="35" x2="130" y2="20" stroke="#ff6b35" strokeWidth="2.5" />
      <line x1="130" y1="20" x2="200" y2="20" stroke="#ff6b35" strokeWidth="2.5" />
      <line x1="85" y1="75" x2="130" y2="90" stroke="#ff6b35" strokeWidth="2.5" />
      <line x1="130" y1="90" x2="200" y2="90" stroke="#ff6b35" strokeWidth="2.5" />
      <polygon points="125,86 125,94 135,90" fill="#ff6b35" />

      <circle r="3" fill="#ff6b35" opacity="0.9">
        <animateMotion dur="1.6s" repeatCount="indefinite" path="M 0 0 L 60 0" />
      </circle>

      <circle r="5" fill="#ff6b35" opacity="0.8">
        <animateMotion dur="1.2s" repeatCount="indefinite" path="M 200 20 L 85 35" />
      </circle>
      <circle r="5" fill="#ff6b35" opacity="0.5">
        <animateMotion dur="1.2s" begin="0.4s" repeatCount="indefinite" path="M 200 20 L 85 35" />
      </circle>

      <text x="20" y="70" fill="#64748b" fontSize="10" textAnchor="middle">B Base</text>
      <text x="210" y="15" fill="#64748b" fontSize="10" textAnchor="middle">C Collector</text>
      <text x="210" y="105" fill="#64748b" fontSize="10" textAnchor="middle">E Emitter</text>

      <rect x="86" y="28" width="20" height="24" rx="3" fill="rgba(255,77,109,0.2)" stroke="#ff4d6d" strokeWidth="1" />
      <text x="96" y="43" textAnchor="middle" fill="#ff4d6d" fontSize="9">BE</text>
      <rect x="86" y="56" width="20" height="24" rx="3" fill="rgba(76,201,240,0.15)" stroke="#4cc9f0" strokeWidth="1" />
      <text x="96" y="71" textAnchor="middle" fill="#4cc9f0" fontSize="9">BC</text>

      <text x="50" y="46" fill="#ff6b35" fontSize="9" textAnchor="middle">Ib (small)</text>
      <text x="165" y="12" fill="#ff6b35" fontSize="9" textAnchor="middle">Ic (large)</text>
    </svg>
  </div>

  <div className={styles.cardInfo}>
    <strong>2 PN junctions</strong>, 3 terminals<br />
    Small current Ib → controls large current Ic<br />
    Gain β = Ic ÷ Ib (can reach 100x+)
  </div>

  <div className={styles.tags}>
    <span className={styles.tag}>2 PN junctions</span>
    <span className={styles.tag}>3 terminals</span>
    <span className={styles.tag}>Amplification / switching</span>
  </div>
</div>

</div>

<div className={styles.relationBox}>
  <div className={styles.relationTitle}>KEY INSIGHT</div>
  <h3>A transistor "contains" diodes, but it isn't a diode</h3>

  <div className={styles.npnWrap}>
    <svg width="580" height="150" viewBox="0 -20 580 150">
      <rect x="60" y="30" width="100" height="60" rx="6" fill="rgba(76,201,240,0.12)" stroke="#4cc9f0" strokeWidth="1.5" />
      <text x="110" y="65" textAnchor="middle" fill="#4cc9f0" fontSize="18" fontWeight="700">N</text>
      <text x="110" y="85" textAnchor="middle" fill="#4cc9f0" fontSize="10">Emitter E</text>

      <rect x="170" y="30" width="80" height="60" rx="6" fill="rgba(255,77,109,0.15)" stroke="#ff4d6d" strokeWidth="1.5" />
      <text x="210" y="65" textAnchor="middle" fill="#ff4d6d" fontSize="18" fontWeight="700">P</text>
      <text x="210" y="85" textAnchor="middle" fill="#ff4d6d" fontSize="10">Base B</text>

      <rect x="260" y="30" width="100" height="60" rx="6" fill="rgba(76,201,240,0.12)" stroke="#4cc9f0" strokeWidth="1.5" />
      <text x="310" y="65" textAnchor="middle" fill="#4cc9f0" fontSize="18" fontWeight="700">N</text>
      <text x="310" y="85" textAnchor="middle" fill="#4cc9f0" fontSize="10">Collector C</text>

      <path d="M 110 15 Q 110 5 160 5 Q 210 5 210 15" fill="none" stroke="#00e5ff" strokeWidth="1.5" strokeDasharray="4,2" />
      <text x="160" y="3" textAnchor="middle" fill="#00e5ff" fontSize="10">Diode ① (BE)</text>

      <path d="M 210 15 Q 210 5 260 5 Q 310 5 310 15" fill="none" stroke="#7c3aed" strokeWidth="1.5" strokeDasharray="4,2" />
      <text x="260" y="3" textAnchor="middle" fill="#7c3aed" fontSize="10">Diode ② (BC)</text>

      <text x="420" y="45" fill="#e2e8f0" fontSize="13" fontWeight="700">But! Put together,</text>
      <text x="420" y="65" fill="#ff6b35" fontSize="13" fontWeight="700">≠ just two diodes</text>
      <text x="420" y="90" fill="#64748b" fontSize="11">The third terminal (B)</text>
      <text x="420" y="107" fill="#64748b" fontSize="11">creates the amplification effect</text>

      <line x1="390" y1="25" x2="390" y2="105" stroke="#1e1e30" strokeWidth="1.5" />
    </svg>
  </div>

  <table className={styles.compareTable}>
    <thead>
      <tr>
        <th>Property</th>
        <th className={styles.tdDiode}>Diode</th>
        <th className={styles.tdTransistor}>Transistor (BJT NPN)</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>PN junctions</td>
        <td className={styles.tdDiode}>1</td>
        <td className={styles.tdTransistor}>2</td>
      </tr>
      <tr>
        <td>Terminals</td>
        <td className={styles.tdDiode}>2 (A, K)</td>
        <td className={styles.tdTransistor}>3 (B, C, E)</td>
      </tr>
      <tr>
        <td>Core function</td>
        <td className={styles.tdDiode}>One-way conduction, rectification</td>
        <td className={styles.tdTransistor}>Current amplification, switching</td>
      </tr>
      <tr>
        <td>Control method</td>
        <td className={styles.tdDiode}>Voltage polarity decides on/off</td>
        <td className={styles.tdTransistor}>Small base current controls large current</td>
      </tr>
      <tr>
        <td>Analogy</td>
        <td className={styles.tdDiode}>One-way check valve</td>
        <td className={styles.tdTransistor}>Faucet (light touch, big flow)</td>
      </tr>
    </tbody>
  </table>
</div>

<div className={styles.footerNote}>
  Transistor ⊃ diode structure ／ but Transistor <span>≠</span> Diode
</div>

</div>
</div>
