g | x | w | all
Bytes Lang Time Link
029JavaScript V8250501T234932ZLucenapo
038Excel221102T184549ZEngineer
008Keg200214T210918Zlyxal
002W200214T150023Zuser9206
008GolfScript200214T143505ZMathgeek
006Jelly180726T185311Zdylnan
004Stax180226T112847ZWeijun Z
008Microscript II180226T120643ZSuperJed
088Java 8180226T103916ZKevin Cr
031Python 3180119T095830Zaaay aaa
004Python Repl170609T100453ZColonel
011JavaScript yet another one170609T081706ZGOTO 0
002Mathematica170608T141853ZBen
008Retina170608T084247ZMartin E
032Braingolf170608T081657ZMayube
032JavaScript ES6170607T200129ZNeil
006Fission 2170607T180301ZLuke
007Jelly170608T004012ZDennis
158Brainfuck170607T215801Z6infinit
015JavaScript ES6170607T215110ZRick Hit
014Ohm170607T212905ZDatboi
008Befunge98170607T212150Zovs
006CJam170607T210635ZMartin E
008QBIC170607T204638Zsteenber
01005AB1E170607T195921ZMagic Oc
020Groovy170607T201709ZMagic Oc
010str170607T190801ZConor O&
032Python 3170607T190519ZCalculat
039Haskell170607T190141ZLaikoni
011Befunge170607T185942ZMegaTom
007><>170607T172740Zuser4180
008CJam170607T190225ZBusiness
044PHP170607T175119ZJör
008Ruby170607T184416ZWheat Wi
036Bash170607T180334ZDoorknob
009Japt170607T174845ZETHprodu
034shortC170607T175131ZMD XF
060C170607T174755ZMD XF
01305AB1E170607T174652ZRiley
020Ruby170607T174223ZDoorknob
004V170607T174200ZRiley
7613Klein170607T173642ZWheat Wi
002Pyth170607T173513ZRod

JavaScript (V8), 29 bytes

f=t=>print('=f'+f+';f()');f()

Try it online!

Excel, 38 bytes

=REPT("=REPT(CHAR(34),2)&"&CHAR(34),2)

Output is:

=REPT(CHAR(34),2)&"=REPT(CHAR(34),2)&"

If you sort and concatenate the characters from either, you get this:

""&&(((()))),,==223344AACCEEHHPPRRRRTT

Keg, 8 bytes

`.,:`:,.

Try it online!

A rearrangement of the usual quine.

W, 2 bytes

1-

Explanation

a   % (Implicit) argument of the input
    % The input is automatically set to 0
    % if it isn't specified
 1- % Minus 1 over the input (i.e. 0-1 = -1)

Output:

-1

GolfScript, 8 bytes

{}*{.*}.

Output is {.*}{.*}

Works because the first three characters are garbage to find a way to get another set of braces in the program that don't show up.

If you don't care about whitespace, then {+}{.}+. outputs {+ .}{+ .}, which was my first attempt.

Try it online!

Jelly, 6 bytes

00,”ṘṘ

Try it online!

Output is

0,”Ṙ0Ṙ

Stax, 8 4 bytes

.S.S

Run and debug online!

A direct port of this answer.

Old version, 8 bytes

..b..LbL

Run and debug online!

Alternative version with a pretty cheap trick that can be applied to proper quines in almost any language.

"43bL"34bL

Run and debug online!

Because "34bL"34bL is a proper quine in Stax.

Yet another version, using only single-char string literals.

''c'Lc'cccLcLL

Run and debug online!

Explanation

.S.S        Generates powerset ["","S","S.","."]
            Implicit flatten and output

..b         Push string ".b"
   ..L      Push string ".L"
      b     Duplicate both strings
       L    Concatenate all 4 strings to a single one.

Microscript II, 8 bytes

"phq"pqh

Microscript, 11 bytes (also a reverse quine):

0"Caxq"Caxq

Java 8, 88 bytes

v->{String s="-v>{String s=%c%s%1$c;return s.format(s,34,s);}";return s.format(s,34,s);}

Outputs with both v and - swapped as anagram:

-v>{String s="-v>{String s=%c%s%1$c;return s.format(s,34,s);}";return s.format(s,34,s);}

Explanation:

Try it online.

Python 3, 31 bytes

a='a=%r;pritn(a%%a)';print(a%a)

Python Repl, 4 bytes

This is my first Code Golf solution, so I hope it meets the rules. In the Python 2 or 3 interactive interpreter:

>>> (1),
(1,)

The output is an anagram of the input.


Another:

>>> 2*'2*'
'2*2*'

In Python 2:

>>> type('rst <>'),
(<type 'str'>,)

In Python 3:

>> {1, 0}
{0, 1}

Update 2017-06-15: Yet another:

>>> 01.
1.0

JavaScript (yet another one), 11 bytes

f=_=>'=f'+f

Called with f(), outputs

=f_=>'=f'+f

f=_=>'=f'+f

console.log(f());

Mathematica, 2 bytes

.0

Output:

0.

A number starting with a decimal point such as .123 is interpreted as 0.123, so .0 is interpreted as 0.0. Since the part of the number after the decimal point is zero, Mathematica does not print it.

Retina, 8 bytes


_

$nn$

Try it online!

Prints


n$_
n$

Both contain one _, two n, two $ and three linefeeds.

Note that a linefeed followed by almost any other character is a trivial solution, but it's questionable whether it's valid, because the second character only encodes itself and the linefeed doesn't really encode either output character.

Explanation


_

Replace the empty input with a _.


$nn$

Match an empty string, which happens both before or after the _ and insert a linefeed ($n), an n, and a $. Since we first inserted that _, this adds each of those characters twice, so the n and $ account for the $n, and we get two of the three linefeeds we need in the output. The third linefeed is printed because Retina prints a trailing linefeed by default.

We could also use n$n$ in this stage, which would then print:

n
$_n
$

Braingolf, 36 32 bytes

"V#!1+!@@R!&@&@;"V#!1+!@@R!&@&@;

Try it online!

Outputs ""V#!1+!@@R!&@&@;V#!1+!@@R!&@&@;, which is the source, but with both " at the start, the ; is required at the end to prevent a trailing newline

Explanation:

"V#!1+!@@R!&@&@;"V#!1+!@@R!&@&@;  
"V#!1+!@@R!&@&@;"                 Pushes the charcode of each char in the string
                 V                Create stack2 and switch to it
                  #!              Push charcode of !
                    1+            Increment to charcode of "
                      !@@         Print twice, popping the 2nd time
                         R        Return to stack1
                          !&@&@   Print entire stack twice, popping the 2nd time
                               ;  Suppress implicit output to prevent trailing newline

Alternatively (not sure this one actually meets the requirement of it being a proper quine):

Braingolf, 2 bytes


1

\n1, outputs 1\n

Explanation:

\n1
\n   No-op, does nothing
  1  Pushes 1
     Implicit output of last item on stack plus trailing newline

JavaScript (ES6), 40 32 bytes

f=($=`($)=>{$=$+"${"``"}$"}`)=>$+$

No messing around with Function.toString either. As a bonus, the code inside the string almost looks legal. Edit: Saved 8 bytes by using + instead of repeat(2).

Fission 2, 9 8 6 bytes

R"'!+O

Try it online!

Explanation

An atom is created at R, which moves right. This atom then comes across a ", which starts printing mode. In printing mode, all characters (until the matching ") are printed. This means it prints '!+OR in this case. Then, all that is left is printing ", which is done by the remaining characters. '! sets the atom's mass to the character code of !, and + increments it to the character code of ". Then, the character code is output by O and the atom is destroyed, ending the program.

(Actually, this is just a rotation of the shortest quine)

Jelly, 7 bytes

“ØvṚ”Ṙv

Try it online!

Brainfuck, 158 bytes

>>--<<-[[<+>->+>->+++<<<]>-]<<<<<<[--->>.<<]>>++<<<[->>>.<<<]>>-<<<[--->>>.<<<]>>>--<<<<[++>>>>.<<<<]>>>>+++>--.[---<.>]>+.......++.......<<<>>>>>>>>>-----+++

Try it online!

It may not be the shortest version, but at least it works.

Fun fact, the output code can actually be executed (and it does terminate).

Output

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>--------------------------++++++++++++++++++<....................[[[[[[[]]]]]]]

Explanation

>>--<<-[[<+>->+>->+++<<<]>-]    Initializes the tape with the
                                help of a recurrence relation.
<<<<<<[--->>.<<]>>++<<<[->>>
.<<<]>>-<<<[--->>>.<<<]>>>--    Prints the characters using
<<<<[++>>>>.<<<<]>>>>+++>--.    classic loops.
[---<.>]>+.......++.......

<<<>>>>>>>>>-----+++            Junk to complete the anagram.

JavaScript (ES6), 15 bytes

f=(s='f=')=>f+s

Outputs:

(s='f=')=>f+sf= 

Snippet:

f=(s='f=')=>f+s

console.log(f());

Ohm, 14 bytes

"æ3M.Cæ"æ3M."C

Try it online!

Output:

æ3M.CæC.M3æ"""

Explanation

"æ3M.Cæ"æ3M."C
"æ3M.Cæ"       # Pushes "æ3M.Cæ"
        æ      # Palindrone of that string
         3M    # 3 times...
           ."   # Push " on the stack
             C  # Concatenate with the string above

Befunge-98, 8 bytes

"'$<@,k7

Try it online!

CJam, 6 bytes

"_`"_`

Try it online!

Prints

_`"_`"

Explanation

"_`"   e# Push this string.
_      e# Duplicate.
`      e# Stringify it, which wraps it in quotes.
       e# Implicitly print stack contents.

QBIC, 8 bytes

?A+@?A@+

I just figured out how to do a proper quine in QBIC. Making an anagram out of it is done by simply switching around the characters in the string literal. There are 24 possible anagrams this way.

05AB1E, 10 bytes

'∞∞''∞'JJ∞

Try it online!

Output:

∞∞''JJ''∞∞

Explanation:

Code       | Explanation                | Stack
-----------+----------------------------+-------------------
'∞         | Push literal '∞'.          | ["∞"]
  ∞        | Mirror.                    | ["∞∞"]
   ''      | Push literal "'".          | ["∞∞","'"]
     ∞     | Mirror.                    | ["∞∞","''"]
      'J   | Push literal 'J'.          | ["∞∞","''","J"]
        J  | Join it all together.      | ["∞∞''J"]
         ∞ | Mirror.                    | ["∞∞''JJ''∞∞"]
-----------+----------------------------+-------------------
           | Implicit print.            | ∞∞''JJ''∞∞

Groovy, 24 20 bytes

{"""{""*""2""}"""*2}

-4 thanks to CalculatorFeline, the whitespace wasn't needed after all!

Output:

{""*""2""}{""*""2""}

Explanation:

Anonymous closure that, when called, returns {""*""2""} two times (concatenated).

str, 10 bytes

`2xr;`2xr;

Try it online! Outputs `2xr;2xr;`

`2xr;`2xr;
.........;   preamble
`2xr;`       a string containing those character
      2x     repeat twice
        r    print the representation of that doubled string
         ;   end preamble (no program)

Python 3, 32 bytes

print("""p"r"i"n"t"2(")*"""*2)

Prints p"r"i"n"t"2(")*p"r"i"n"t"2(")*\n, sorted output: \n""""""""""""(())**22iinnpprrtt

Haskell, 38 39 bytes

main=print$[0,0]>>"main=print$[0,0]>>"

Try it online! Output:

"main=print$[0,0]>>main=print$[0,0]>>"

Edit: +1 byte because I previously forgot about the implicit trailing newline of print.


Alternative: (Same byte count but does not contain ASCII-owl)

main=print$e++e;e="main=print$e++e;e="

Try it online!

Output:

"main=print$e++e;e=main=print$e++e;e="

Befunge, 11 bytes

' 2+">:#,_@

Prints:

+2 '@_,#:>"

Explanation:

' 2+"        Put a " on the stack (32 + 2)
    "        Put the rest of the code on stack (wrap-around string)
     >:#,_   Print stack
          @  End

><>, 9 8 7 bytes

Golfed 1 byte thanks to @WheatWizard by using ! and incrementing it to get "

Golfed 1 byte thanks to @ConorO'Brien by using # instead of <!

":1->o#

Try it online!

Outputs "#o>-1:.

Explanation

":1->o#"        Push this string (note that the IP wraps around)
:               Duplicate the top value of the stack (35 from the "#")
1-              Subtract one from it to get 34 ('"')
>o#             Print every character on the stack until the program cannot pop any more and still tries to pop a value from the stack afterwards
                The program exits with an error from not being able to pop a value from an empty stack

CJam, 8 bytes

"2*`"2*`

Try it online!

Explanation

Similar to the Python example in the question

"2*`"     e# Push the string "2*`"
     2*   e# Repeat it twice
       `  e# Get its string representation (wrap in quotes)

The output is "2*`2*`".

PHP, 44 bytes

<?=str_repeat('<?=\str_\repeat(\'\',2);',2);

Try it online!

Ruby, 8 bytes

p"p*2"*2

Try it online!

This prints

"p*2p*2"

Explanation

This works similar to the python answer in the question. It will make the string p*2p*2 then using Ruby's p will print the representation of the string.

Bash, 36 bytes

tee f<<<'tee f<<<""cat f'"''"
cat f

This outputs

tee f<<<""cat f''
tee f<<<""cat f''

(and creates the file f as a side effect, but that's allowed per meta.)

Both the program and output have a trailing newline.

Thought process: I figured that the easiest way to output a string two times, aside from assigning it to a variable, was to do

tee f<<<string
cat f

The string needs to be quoted because it will contain spaces and < characters, so then I had

tee f<<<'tee f<<<cat f'
cat f

which almost works, except it doesn't output the quotes. Fortunately, Bash supports string literal concatenation by simply placing them next to each other, so appending "''" to the herestring and inserting "" inside the single quote part yields this solution.

Japt, 10 9 bytes

Found a better way :-)

Q+2ç"Q+2ç

Outputs "Q+2çQ+2ç. Test it online!

Explanation

Q+2ç"Q+2ç    // Implicit: Q = quotation mark
    "Q+2ç    // Take this string.     Q+2ç
  2ç         // Repeat it twice.      Q+2çQ+2ç
Q+           // Prepend a quote.      "Q+2çQ+2ç
             // Implicit: output result of last expression

Could also be Qi2ç"Qi2ç, which prints Qi2çQi2ç". This one is closer to the standard Japt quine:

"iQ ²"iQ ²

But I do not believe there is any easy way to wedge the quotation mark in the middle of the string for a 9-byte quine.

shortC, 34 bytes

Bs){Rs="Bs){s=R%c%s%1$c,34,s",34,s

Output:

Bs){s=R"Bs){s=R%c%s%1$c,34,s",34,s

Try it online!

C, 60 bytes

main(s){printf(s="main(s){s=printf(%c%s%1$c,34,s);}",34,s);}

Just the shortest C quine with trivial modifications.

Output:

main(s){s=printf("main(s){s=printf(%c%s%1$c,34,s);}",34,s);}

Try it online!

05AB1E, 13 bytes

"34çJ∞"34çJ∞

Outputs:

34çJ∞""∞Jç43

Try it online!

"34çJ∞"      # Push this string                 | [ 34çJ∞ ]
       34ç   # Push a quote (")                 | [ 34çJ∞, " ]
          J  # Join                             | [ 34çJ∞" ]
           ∞ # Mirror                           | [ 34çJ∞""∞Jç43 ]
             # Implicitly output with a newline

Ruby, 20 bytes

$><<%q($><<%q()*2)*2

This outputs

$><<%q()*2$><<%q()*2

Taking advantage of Ruby's %q(...) string syntax, which supports nested parentheses.

V, 4 bytes

2ii2

Outputs:

i2i2

Try it online!

Klein, 7 + 6 = 13 bytes

Here's an answer based on the ><> answer.

":1+@!

Try it online!

This outputs

:1+@!"

Pyth, 2 bytes

)(

Outputs

()

Try it online!

)  # Ends statement, does nothing in this program
 ( # Create an empty tuple
   # Implicitly print the empty tuple