Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <input type="file" accept=".jpg, .jpeg, .png" name="file-input" id="fileInput" style="display: none;" onchange="imageChange()">

<button class="waves-effect waves-light btn" onclick="">
  <i class="material-icons left">image</i>
  Select Image
<div class="result">
  <div class="img left">
    <img src="" alt="" id="selectImage" width="300">
  <div class="left">
    <ul id="resultList" class="collection result-list"></ul>
    <span id="totalBinary"></span>


                body {
  margin: 20px;
.result {
  margin: 20px 0;
  border-top: 1px solid #eee;
  padding: 20px 0;
.result .img {
  width: 300px;
  margin-right: 20px;
.result .result-list {
  overflow-y: scroll;
  max-height: 200px;
  margin-top: 0px;



                var fileInput = document.getElementById('fileInput');
var selectImage = document.getElementById('selectImage');
var resultList = document.getElementById('resultList');
var totalBinary = document.getElementById('totalBinary');

function imageChange()
  var files = fileInput.files;
  if (files.length) {
    var urlReader = new FileReader();
    urlReader.onload = (e) => {
      selectImage.src =;

    var textReader = new FileReader();
    textReader.onload = (e) => {

function factoring(str)
  resultList.innerHTML = "";
  var uniqueBins = {};
  for (var i = 0; i < str.length; i++) {
    var s = str.charCodeAt(i).toString(16);
    if (s.length == 1) {
      s = "0" + s;
    uniqueBins[s] = uniqueBins[s] ? uniqueBins[s] + 1 : 1;
  for (let bin in uniqueBins) {
    var li = document.createElement('li');
    li.innerHTML = `【${bin}】:  ${uniqueBins[bin]}個`;
  totalBinary.innerHTML = `合計バイナリ数: ${str.length}個`;